Skip to content

Commit 63f82a3

Browse files
committed
fix same token selection bug
1 parent effe03c commit 63f82a3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/core-mobile/app/new/features/swapV2/screens/SwapScreen.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,8 @@ export const SwapScreen = (): JSX.Element => {
582582

583583
useEffect(() => {
584584
if (fromToken && toToken && fromToken.localId === toToken.localId) {
585-
if (prevFromRef.current !== fromToken) {
586-
setToToken(undefined)
587-
} else if (prevToRef.current !== toToken) {
588-
setFromToken(undefined)
589-
}
590-
585+
// Always clear the "to" field when same token is selected (matches swap v1 behavior)
586+
setToToken(undefined)
591587
setAmount(undefined)
592588
setToTokenValue(undefined)
593589
setFromTokenValue(undefined)

0 commit comments

Comments
 (0)