diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 43ef88ffd7..3879607df8 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -12,6 +12,7 @@ import styled from 'styled-components'; import { formatBalance, formatNumber, isObject } from '@polkadot/util'; import { Icon, Tooltip, TxButton } from '@polkadot/react-components'; import { withCalls, withMulti } from '@polkadot/react-api'; +import { useAccounts } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import CryptoType from './CryptoType'; @@ -224,7 +225,7 @@ function renderValidatorPrefs ({ stakingInfo, t, withValidatorPrefs = false }: P ); } -function renderBalances (props: Props): React.ReactNode { +function renderBalances (props: Props, allAccounts: string[]): React.ReactNode { const { balancesAll, stakingInfo, t, withBalance = true } = props; const balanceDisplay = withBalance === true ? DEFAULT_BALANCES @@ -235,6 +236,7 @@ function renderBalances (props: Props): React.ReactNode { } const [ownBonded, otherBonded] = calcBonded(stakingInfo, balanceDisplay.bonded); + const controllerId = stakingInfo?.controllerId?.toString(); return ( <> @@ -256,7 +258,7 @@ function renderBalances (props: Props): React.ReactNode { /> )} - {balancesAll && balanceDisplay.vested && balancesAll.isVesting && ( + {balanceDisplay.vested && balancesAll?.isVesting && ( <>