From 8df6a573453b47171754a82c07aec7135e2ee6fb Mon Sep 17 00:00:00 2001 From: Bartek <bartlomiejkramek@outlook.com> Date: Wed, 18 Dec 2024 13:12:25 +0100 Subject: [PATCH] fix --- .../src/hooks/useTransactionHistory.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts index e25a3caea5..d3760f2be7 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts +++ b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts @@ -831,13 +831,9 @@ const useMappedSenderTransactionHistory = ({ const updatePendingTransaction = useCallback( async (tx: MergedTransaction) => { - if (!senderTxPages) { - return - } - - const foundInSwrCache = senderTxPages - .flat() - .find(t => tx.txId === t.txId && tx.childChainId === t.childChainId) + const foundInSwrCache = senderTransactionsWithNewTransactions.find( + t => tx.txId === t.txId && tx.childChainId === t.childChainId + ) if (!foundInSwrCache) { return @@ -846,7 +842,7 @@ const useMappedSenderTransactionHistory = ({ const updatedPendingTransaction = await getUpdatedPendingTransaction(tx) updateTransactionInSwrCache(updatedPendingTransaction) }, - [senderTxPages, updateTransactionInSwrCache] + [senderTransactionsWithNewTransactions, updateTransactionInSwrCache] ) // based on an example from SWR