Skip to content

Commit

Permalink
fix: fix display amount when price checker off
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Nov 21, 2024
1 parent 5c48902 commit 1baacb6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ui/components/app/wallet-overview/coin-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ import {
import Spinner from '../../ui/spinner';

import { PercentageAndAmountChange } from '../../multichain/token-list-item/price/percentage-and-amount-change/percentage-and-amount-change';
import { getMultichainIsEvm } from '../../../selectors/multichain';
import {
getMultichainIsEvm,
getMultichainShouldShowFiat,
} from '../../../selectors/multichain';
import { useAccountTotalFiatBalance } from '../../../hooks/useAccountTotalFiatBalance';
import {
setAggregatedBalancePopoverShown,
Expand All @@ -72,6 +75,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext';
import WalletOverview from './wallet-overview';
import CoinButtons from './coin-buttons';
import { AggregatedPercentageOverview } from './aggregated-percentage-overview';
import { useMultichainSelector } from '../../../hooks/useMultichainSelector';

export type CoinOverviewProps = {
balance: string;
Expand Down Expand Up @@ -144,9 +148,14 @@ export const CoinOverview = ({
shouldHideZeroBalanceTokens,
);

const shouldShowFiat = useMultichainSelector(
getMultichainShouldShowFiat,
account,
);

const isEvm = useSelector(getMultichainIsEvm);
const isNotAggregatedFiatBalance =
showNativeTokenAsMainBalance || isTestnet || !isEvm;
!shouldShowFiat || showNativeTokenAsMainBalance || isTestnet || !isEvm;
let balanceToDisplay;
if (isNotAggregatedFiatBalance) {
balanceToDisplay = balance;
Expand Down Expand Up @@ -278,7 +287,9 @@ export const CoinOverview = ({
hideTitle
shouldCheckShowNativeToken
isAggregatedFiatOverviewBalance={
!showNativeTokenAsMainBalance && !isTestnet
!showNativeTokenAsMainBalance &&
!isTestnet &&
shouldShowFiat
}
privacyMode={privacyMode}
/>
Expand Down

0 comments on commit 1baacb6

Please sign in to comment.