Skip to content

Commit

Permalink
fix transaction refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK committed Mar 3, 2024
1 parent f2fbdeb commit 5b601e8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/bridge-ui/src/components/Transactions/Transactions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,7 @@
// We want to make sure that we are connected and only
// fetch if the account has changed
if (newAccount?.isConnected && newAccount.address && newAccount.address !== oldAccount?.address) {
loadingTxs = true;
try {
await updateTransactions(newAccount.address);
} catch (err) {
console.error(err);
// TODO: handle
} finally {
loadingTxs = false;
}
await updateTransactions(newAccount.address);
}
};
Expand All @@ -95,6 +86,7 @@
};
const updateTransactions = async (address: Address) => {
if (loadingTxs) return;
loadingTxs = true;
const { mergedTransactions, outdatedLocalTransactions, error } = await fetchTransactions(address);
transactions = mergedTransactions;
Expand All @@ -108,6 +100,8 @@
loadingTxs = false;
};
$: $account?.address && $account.isConnected, refresh();
$: statusFilteredTransactions =
selectedStatus !== null ? transactions.filter((tx) => tx.status === selectedStatus) : transactions;
Expand Down Expand Up @@ -149,7 +143,6 @@
// if only two chains are available, set the destination chain to the other one
$destNetwork = chainIdToChain(alternateChainID);
}
refresh();
});
</script>

Expand Down

0 comments on commit 5b601e8

Please sign in to comment.