Skip to content

Commit

Permalink
fix: fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb committed Nov 20, 2024
1 parent dac63f2 commit 89a2f7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/hooks/useTokenFiatAmount.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
getConfirmationExchangeRates,
getMarketData,
getCurrencyRates,
getNetworkConfigurationsByChainId,
} from '../selectors';
import { getTokenFiatAmount } from '../helpers/utils/token-util';
import { getConversionRate } from '../ducks/metamask/metamask';
import { isEqualCaseInsensitive } from '../../shared/modules/string-utils';
import { CHAIN_ID_TO_CURRENCY_SYMBOL_MAP } from '../../shared/constants/network';

/**
* Get the token balance converted to fiat and formatted for display
Expand Down Expand Up @@ -62,9 +62,13 @@ export function useTokenFiatAmount(

const currencyRates = useSelector(getCurrencyRates);
const conversionRate = useSelector(getConversionRate);
const networkConfigurationsByChainId = useSelector(
getNetworkConfigurationsByChainId,
);

const tokenConversionRate = chainId
? currencyRates[CHAIN_ID_TO_CURRENCY_SYMBOL_MAP[chainId]]?.usdConversionRate
? currencyRates[networkConfigurationsByChainId[chainId].nativeCurrency]
.conversionRate
: conversionRate;

const currentCurrency = useSelector(getCurrentCurrency);
Expand Down

0 comments on commit 89a2f7f

Please sign in to comment.