Skip to content

Commit

Permalink
Merge branch 'fix/20240924_style' into tmp/20240927
Browse files Browse the repository at this point in the history
  • Loading branch information
richardo2016x committed Sep 24, 2024
2 parents b97dbb9 + 8c39b18 commit 2aeedb3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ui/views/Swap/hooks/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export const useTokenPair = (userAddress: string) => {

const closeReserveGasOpen = useCallback(() => {
setReserveGasOpen(false);
}, []);

const closeReserveGasOpenAndUpdatePayAmount = useCallback(() => {
setReserveGasOpen(false);

if (payToken && gasPriceRef.current !== undefined) {
const val = tokenAmountBn(payToken).minus(
new BigNumber(gasLimit)
Expand All @@ -352,9 +357,9 @@ export const useTokenPair = (userAddress: string) => {
(gasLevel: GasLevel) => {
gasPriceRef.current = gasLevel.level === 'custom' ? 0 : gasLevel.price;
setGasLevel(gasLevel.level as GasLevelType);
closeReserveGasOpen();
closeReserveGasOpenAndUpdatePayAmount();
},
[closeReserveGasOpen]
[closeReserveGasOpenAndUpdatePayAmount]
);

const handleBalance = useCallback(() => {
Expand Down

0 comments on commit 2aeedb3

Please sign in to comment.