diff --git a/src/components/change-wallet/AddressRow.tsx b/src/components/change-wallet/AddressRow.tsx index 9b9c76744fc..71f3ee08e16 100644 --- a/src/components/change-wallet/AddressRow.tsx +++ b/src/components/change-wallet/AddressRow.tsx @@ -121,19 +121,30 @@ interface AddressRowProps { export default function AddressRow({ contextMenuActions, data, editMode, onPress }: AddressRowProps) { const notificationsEnabled = useExperimentalFlag(NOTIFICATIONS); - const { address, balances, color: accountColor, ens, image: accountImage, isSelected, isReadOnly, isLedger, label, walletId } = data; + const { + address, + balancesMinusHiddenBalances, + color: accountColor, + ens, + image: accountImage, + isSelected, + isReadOnly, + isLedger, + label, + walletId, + } = data; const { colors, isDarkMode } = useTheme(); const labelQuaternary = useForegroundColor('labelQuaternary'); const balanceText = useMemo(() => { - if (!balances) { + if (!balancesMinusHiddenBalances) { return lang.t('wallet.change_wallet.loading_balance'); } - return balances.balancesMinusHiddenBalances; - }, [balances]); + return balancesMinusHiddenBalances; + }, [balancesMinusHiddenBalances]); const cleanedUpLabel = useMemo(() => removeFirstEmojiFromString(label), [label]); diff --git a/src/hooks/useWalletBalances.ts b/src/hooks/useWalletBalances.ts index 6b770fc29b4..d29f8f301a8 100644 --- a/src/hooks/useWalletBalances.ts +++ b/src/hooks/useWalletBalances.ts @@ -29,6 +29,12 @@ export type WalletBalanceResult = { isLoading: boolean; }; +/** + * Hook to fetch balances for all wallets + * @deprecated - you probably want to use useWalletsWithBalancesAndNames instead which accounts for hidden assets balances + * @param wallets - All Rainbow wallets + * @returns Balances for all wallets + */ const useWalletBalances = (wallets: AllRainbowWallets): WalletBalanceResult => { const { nativeCurrency } = useAccountSettings();