|
@@ -18,7 +18,7 @@ import { AddressInfo, AddressMini, AddressSmall, Badge, Button, CryptoType, Forg
|
|
import { useAccountInfo, useApi, useCall, useToggle } from '@polkadot/react-hooks';
|
|
import { useAccountInfo, useApi, useCall, useToggle } from '@polkadot/react-hooks';
|
|
import { Option } from '@polkadot/types';
|
|
import { Option } from '@polkadot/types';
|
|
import keyring from '@polkadot/ui-keyring';
|
|
import keyring from '@polkadot/ui-keyring';
|
|
-import { BN_ZERO, formatBalance, formatNumber } from '@polkadot/util';
|
|
|
|
|
|
+import { BN_ZERO, formatBalance, formatNumber, isFunction } from '@polkadot/util';
|
|
|
|
|
|
import { useTranslation } from '../translate';
|
|
import { useTranslation } from '../translate';
|
|
import { createMenuGroup } from '../util';
|
|
import { createMenuGroup } from '../util';
|
|
@@ -361,9 +361,9 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
)}
|
|
)}
|
|
</td>
|
|
</td>
|
|
<td className='address ui--media-1400'>
|
|
<td className='address ui--media-1400'>
|
|
- {meta.parentAddress && (
|
|
|
|
|
|
+ {meta.parentAddress ? (
|
|
<AddressMini value={meta.parentAddress} />
|
|
<AddressMini value={meta.parentAddress} />
|
|
- )}
|
|
|
|
|
|
+ ) : ''}
|
|
</td>
|
|
</td>
|
|
<td className='number'>
|
|
<td className='number'>
|
|
<CryptoType accountId={address} />
|
|
<CryptoType accountId={address} />
|
|
@@ -407,7 +407,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
vertical
|
|
vertical
|
|
>
|
|
>
|
|
{createMenuGroup([
|
|
{createMenuGroup([
|
|
- api.api.tx.identity?.setIdentity && (
|
|
|
|
|
|
+ isFunction(api.api.tx.identity?.setIdentity) && (
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='identityMain'
|
|
key='identityMain'
|
|
onClick={toggleIdentityMain}
|
|
onClick={toggleIdentityMain}
|
|
@@ -415,7 +415,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Set on-chain identity')}
|
|
{t('Set on-chain identity')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
),
|
|
),
|
|
- api.api.tx.identity?.setSubs && identity?.display && (
|
|
|
|
|
|
+ isFunction(api.api.tx.identity?.setSubs) && identity?.display && (
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='identitySub'
|
|
key='identitySub'
|
|
onClick={toggleIdentitySub}
|
|
onClick={toggleIdentitySub}
|
|
@@ -423,7 +423,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Set on-chain sub-identities')}
|
|
{t('Set on-chain sub-identities')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
),
|
|
),
|
|
- api.api.tx.democracy?.unlock && democracyUnlockTx && (
|
|
|
|
|
|
+ isFunction(api.api.tx.democracy?.unlock) && democracyUnlockTx && (
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='clearDemocracy'
|
|
key='clearDemocracy'
|
|
onClick={_clearDemocracyLocks}
|
|
onClick={_clearDemocracyLocks}
|
|
@@ -431,7 +431,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Clear expired democracy locks')}
|
|
{t('Clear expired democracy locks')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
),
|
|
),
|
|
- api.api.tx.vesting?.vest && vestingVestTx && (
|
|
|
|
|
|
+ isFunction(api.api.tx.vesting?.vest) && vestingVestTx && (
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='vestingVest'
|
|
key='vestingVest'
|
|
onClick={_vestingVest}
|
|
onClick={_vestingVest}
|
|
@@ -484,7 +484,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
)
|
|
)
|
|
])}
|
|
])}
|
|
- {api.api.tx.recovery?.createRecovery && createMenuGroup([
|
|
|
|
|
|
+ {isFunction(api.api.tx.recovery?.createRecovery) && createMenuGroup([
|
|
!recoveryInfo && (
|
|
!recoveryInfo && (
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='makeRecoverable'
|
|
key='makeRecoverable'
|
|
@@ -500,7 +500,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Initiate recovery for another')}
|
|
{t('Initiate recovery for another')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
])}
|
|
])}
|
|
- {api.api.tx.multisig?.asMulti && isMultisig && createMenuGroup([
|
|
|
|
|
|
+ { isFunction(api.api.tx.multisig?.asMulti) && isMultisig && createMenuGroup([
|
|
<Menu.Item
|
|
<Menu.Item
|
|
disabled={!multiInfos || !multiInfos.length}
|
|
disabled={!multiInfos || !multiInfos.length}
|
|
key='multisigApprovals'
|
|
key='multisigApprovals'
|
|
@@ -509,7 +509,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Multisig approvals')}
|
|
{t('Multisig approvals')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
])}
|
|
])}
|
|
- {api.api.query.democracy?.votingOf && delegation?.accountDelegated && createMenuGroup([
|
|
|
|
|
|
+ { isFunction(api.api.query.democracy?.votingOf) && delegation?.accountDelegated && createMenuGroup([
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='changeDelegate'
|
|
key='changeDelegate'
|
|
onClick={toggleDelegate}
|
|
onClick={toggleDelegate}
|
|
@@ -523,7 +523,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
|
|
{t('Undelegate')}
|
|
{t('Undelegate')}
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
])}
|
|
])}
|
|
- {api.api.query.democracy?.votingOf && !delegation?.accountDelegated && createMenuGroup([
|
|
|
|
|
|
+ {isFunction(api.api.query.democracy?.votingOf) && !delegation?.accountDelegated && createMenuGroup([
|
|
<Menu.Item
|
|
<Menu.Item
|
|
key='delegate'
|
|
key='delegate'
|
|
onClick={toggleDelegate}
|
|
onClick={toggleDelegate}
|