Skip to content

Commit

Permalink
fix: include index when generating activity cell keys (#1735)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Sinclair <[email protected]>
  • Loading branch information
derHowie and DanielSinclair authored Oct 25, 2024
1 parent 1e181e0 commit 7627a14
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/entries/popup/hooks/useInfiniteTransactionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,20 @@ export const useInfiniteTransactionList = ({
return transactionsAfterCutoff;
}, [currentAddressCustomNetworkTransactions, cutoff, transactions]);

const formattedTransactions = useMemo(
() =>
Object.entries(
selectTransactionsByDate([
...pendingTransactions,
...transactionsAfterCutoff,
]),
).flat(2),
[pendingTransactions, transactionsAfterCutoff],
);
const formattedTransactions = useMemo(() => {
const pendingHashes: string[] = [];
pendingTransactions.forEach((tx) =>
pendingHashes.push(`${tx.hash}_${tx.chainId}`),
);
return Object.entries(
selectTransactionsByDate([
...pendingTransactions,
...transactionsAfterCutoff.filter(
(tx) => !pendingHashes.includes(`${tx.hash}_${tx.chainId}`),
),
]),
).flat(2);
}, [pendingTransactions, transactionsAfterCutoff]);

const infiniteRowVirtualizer = useVirtualizer({
count: formattedTransactions?.length,
Expand All @@ -116,7 +120,7 @@ export const useInfiniteTransactionList = ({
const txOrLabel = formattedTransactions[i];
return typeof txOrLabel === 'string'
? txOrLabel
: txOrLabel.hash + txOrLabel.chainId;
: txOrLabel.hash + txOrLabel.chainId + txOrLabel.status;
},
[formattedTransactions],
),
Expand Down

0 comments on commit 7627a14

Please sign in to comment.