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