Skip to content

Commit b621b83

Browse files
committed
reset when token not found
1 parent adb6efd commit b621b83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/wallet-mobile/src/features/Swap/common/SwapProvider.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ export const SwapProvider = ({children}: {children: React.ReactNode}) => {
5555
queryKey: ['useSwapTokenIds', network, swapManager.config.routingPreference],
5656
queryFn: async () => {
5757
const res = await swapManager.api.tokens()
58-
if (isRight(res)) return res.value.data.map(({id}) => id)
58+
if (isRight(res)) {
59+
const tokenIds = res.value.data.map(({id}) => id)
60+
if (!tokenIds.includes(state.tokenOutInput.tokenId ?? undefinedToken)) action({type: 'ResetForm'})
61+
return tokenIds
62+
}
5963
return []
6064
},
6165
})

0 commit comments

Comments
 (0)