fix: reset to defaultTokens when chain changes (#6154)
This commit is contained in:
parent
645d92185a
commit
acc6b0a740
@ -74,14 +74,10 @@ export function useSyncWidgetInputs({
|
||||
|
||||
useEffect(() => {
|
||||
if (chainId !== previousChainId && !!previousChainId && isSupportedChain(chainId)) {
|
||||
setTokens({
|
||||
...tokens,
|
||||
[Field.INPUT]: undefined,
|
||||
[Field.OUTPUT]: undefined,
|
||||
})
|
||||
setTokens(defaultTokens)
|
||||
setAmount(EMPTY_AMOUNT)
|
||||
}
|
||||
}, [chainId, previousChainId, tokens])
|
||||
}, [chainId, defaultTokens, previousChainId, tokens])
|
||||
|
||||
const onAmountChange = useCallback(
|
||||
(field: Field, amount: string, origin?: 'max') => {
|
||||
|
Loading…
Reference in New Issue
Block a user