Skip to content

Commit

Permalink
feat: display only related tx history
Browse files Browse the repository at this point in the history
  • Loading branch information
ogous committed Aug 25, 2024
1 parent bf87090 commit 5a4725a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/components/SwapPro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ export const SwapPro = ({
] as Transaction[];

return transactions
?.filter(
(item) =>
item.amountIn.token.symbol === token0.symbol &&
item.amountOut.token.symbol === token1.symbol,
)
?.map((transaction) => {
return {
id: transaction.timestamp.toString(),
Expand All @@ -173,7 +178,7 @@ export const SwapPro = ({
};
})
.sort((a, b) => (a.time > b.time ? -1 : a.time === b.time ? 0 : 1));
}, [transactions, showMockData]);
}, [transactions, token0.symbol, token1.symbol, showMockData]);

return (
<motion.div
Expand Down

0 comments on commit 5a4725a

Please sign in to comment.