Skip to content

Commit

Permalink
fix: fixing remaining amount calculation if gas token is different (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende authored Feb 5, 2025
1 parent be1e7d7 commit de6cfe3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/namadillo/src/App/Transfer/TransferModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
WalletProvider,
} from "types";
import { getDisplayGasFee } from "utils/gas";
import { parseChainInfo } from "./common";
import { isTransparentAddress, parseChainInfo } from "./common";
import { IbcChannels } from "./IbcChannels";
import { SelectAssetModal } from "./SelectAssetModal";
import { SelectChainModal } from "./SelectChainModal";
Expand Down Expand Up @@ -141,7 +141,14 @@ export const TransferModule = ({
return undefined;
}

if (!displayGasFee || !displayGasFee.totalDisplayAmount) {
if (
!displayGasFee ||
!displayGasFee.totalDisplayAmount ||
// Don't subtract if the gas token is different than the selected asset:
(gasConfig?.gasToken &&
isTransparentAddress(gasConfig.gasToken) &&
gasConfig.gasToken !== selectedAssetAddress)
) {
return availableAmount;
}

Expand Down

0 comments on commit de6cfe3

Please sign in to comment.