diff --git a/src/ui/views/Bridge/Component/BridgeToken.tsx b/src/ui/views/Bridge/Component/BridgeToken.tsx index 2f020dc29be..dc397411779 100644 --- a/src/ui/views/Bridge/Component/BridgeToken.tsx +++ b/src/ui/views/Bridge/Component/BridgeToken.tsx @@ -5,7 +5,7 @@ import { CHAINS_ENUM } from '@debank/common'; import { TokenItem } from '@rabby-wallet/rabby-api/dist/types'; import { Input } from 'antd'; import clsx from 'clsx'; -import React, { useLayoutEffect, useMemo, useRef } from 'react'; +import React, { useEffect, useLayoutEffect, useMemo, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { TokenRender } from '../../Swap/Component/TokenRender'; import { @@ -121,6 +121,12 @@ export const BridgeToken = ({ [chain] ); + useEffect(() => { + if (!fromTokenIsNativeToken) { + handleSetGasPrice?.(); + } + }, [fromTokenIsNativeToken]); + const gasLimit = useMemo( () => (chain === CHAINS_ENUM.ETH ? 1000000 : 2000000), [chain] diff --git a/src/ui/views/Bridge/hooks/token.tsx b/src/ui/views/Bridge/hooks/token.tsx index 3775f721fa8..fbf60bdea2c 100644 --- a/src/ui/views/Bridge/hooks/token.tsx +++ b/src/ui/views/Bridge/hooks/token.tsx @@ -229,6 +229,7 @@ export const useBridge = () => { switchToChain(fromChain, false); setFromToken(toToken); setToToken(fromToken); + setAmount(''); }, [ setFromToken, toToken,