Skip to content

Commit

Permalink
Find last swapAction that meets criteria in makeChainIdsWithActions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao authored Aug 7, 2024
1 parent 89ad453 commit 9207d3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pretty-eggs-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skip-go/widget': patch
---

Show last swap when there are multiple on a chain in transaction preview
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export const makeChainIDsWithAction = ({
);
});

const swapAction = actions.find((action) => {
const reversedActions = actions.slice().reverse();
// Find the last swap action that matches conditions
const swapAction = reversedActions.find((action) => {
if (
index === 0 &&
actions.length <= 2 &&
Expand Down

0 comments on commit 9207d3e

Please sign in to comment.