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 () => {
const walletDeposits = await listValidDepositTransactionsByWalletAddress(
walletAddress.value
);
if (walletDeposits) {
depositList.value = walletDeposits;
}
await listValidDepositTransactionsByWalletAddress(walletAddress.value)
.then((res) => {
if (res) depositList.value = res;
})
.catch(() => {
depositList.value = [];
});
});
watch(networkName, async () => {
await listValidDepositTransactionsByWalletAddress(walletAddress.value).then(
(res) => {
await listValidDepositTransactionsByWalletAddress(walletAddress.value)
.then((res) => {
if (res) depositList.value = res;
}
);
})
.catch(() => {
depositList.value = [];
});
});
</script>

View File

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