Catch list deposit wallet address error to set empty array to wallet transactions

This commit is contained in:
RcleydsonR 2023-01-20 17:56:32 -03:00
parent 358659efca
commit 59538d23d0
2 changed files with 27 additions and 16 deletions

View File

@ -41,20 +41,23 @@ const handleWithDrawDeposit = async (depositID: BigNumber, index: number) => {
}; };
watch(walletAddress, async () => { watch(walletAddress, async () => {
const walletDeposits = await listValidDepositTransactionsByWalletAddress( await listValidDepositTransactionsByWalletAddress(walletAddress.value)
walletAddress.value .then((res) => {
); if (res) depositList.value = res;
if (walletDeposits) { })
depositList.value = walletDeposits; .catch(() => {
} depositList.value = [];
});
}); });
watch(networkName, async () => { watch(networkName, async () => {
await listValidDepositTransactionsByWalletAddress(walletAddress.value).then( await listValidDepositTransactionsByWalletAddress(walletAddress.value)
(res) => { .then((res) => {
if (res) depositList.value = res; if (res) depositList.value = res;
} })
); .catch(() => {
depositList.value = [];
});
}); });
</script> </script>

View File

@ -20,14 +20,22 @@ onMounted(async () => {
}); });
watch(walletAddress, async (newValue) => { watch(walletAddress, async (newValue) => {
await listAllTransactionByWalletAddress(newValue).then((res) => { await listAllTransactionByWalletAddress(newValue)
.then((res) => {
if (res) allUserTransactions.value = res; if (res) allUserTransactions.value = res;
})
.catch(() => {
allUserTransactions.value = [];
}); });
}); });
watch(networkName, async () => { watch(networkName, async () => {
await listAllTransactionByWalletAddress(walletAddress.value).then((res) => { await listAllTransactionByWalletAddress(walletAddress.value)
.then((res) => {
if (res) allUserTransactions.value = res; if (res) allUserTransactions.value = res;
})
.catch(() => {
allUserTransactions.value = [];
}); });
}); });
</script> </script>