Fix errant bonded call (with invalid address) (#925)

This commit is contained in:
Jaco Greeff 2019-04-08 12:46:11 +02:00 committed by GitHub
parent ba0d276ae3
commit 37ba6f0338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -93,7 +93,6 @@ export default translate(
'derive.chain.bestNumberLag',
'query.balances.totalIssuance',
'query.session.validators',
'query.staking.intentions',
'rpc.chain.getRuntimeVersion',
'rpc.system.chain',
'rpc.system.name',

View File

@ -148,8 +148,7 @@ export default withMulti(
withCalls<Props>(
'derive.staking.controllers',
'query.session.validators',
'query.staking.nominators',
['derive.staking.intentionsBalances', { propName: 'balances' }]
'query.staking.nominators'
),
withObservable(accountObservable.subject, { propName: 'allAccounts' })
);

View File

@ -8,6 +8,7 @@ import React from 'react';
import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types';
import { Nonce } from '@polkadot/ui-reactive';
import { withCalls } from '@polkadot/ui-api';
import BaseIdentityIcon from '@polkadot/ui-identicon';
import { classes, toShortAddress } from './util';
import BalanceDisplay from './Balance';
@ -174,11 +175,17 @@ class AddressSummary extends React.PureComponent<Props> {
const [_accountId] = accounts_idAndIndex;
const accountId = (_accountId || value || '').toString();
// Since we do queries to storage in the wrapped example, we don't want
// to follow that route if we don't have a valid address.
const Component = accountId
? IdentityIcon
: BaseIdentityIcon;
return (
<IdentityIcon
<Component
className={className}
size={size || identIconSize}
value={accountId || DEFAULT_ADDR}
value={accountId}
/>
);
}