Skip to content

Commit

Permalink
fix: reset bridge gasprice
Browse files Browse the repository at this point in the history
  • Loading branch information
dmy147 committed Dec 19, 2024
1 parent 0298001 commit 7baeea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/views/Bridge/Component/BridgeToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -121,6 +121,12 @@ export const BridgeToken = ({
[chain]
);

useEffect(() => {
if (!fromTokenIsNativeToken) {
handleSetGasPrice?.();
}
}, [fromTokenIsNativeToken]);

const gasLimit = useMemo(
() => (chain === CHAINS_ENUM.ETH ? 1000000 : 2000000),
[chain]
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/Bridge/hooks/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export const useBridge = () => {
switchToChain(fromChain, false);
setFromToken(toToken);
setToToken(fromToken);
setAmount('');
}, [
setFromToken,
toToken,
Expand Down

0 comments on commit 7baeea0

Please sign in to comment.