diff --git a/packages/app-rpc/src/Account.js b/packages/app-rpc/src/Account.js index e73b443e71..e92534fe8f 100644 --- a/packages/app-rpc/src/Account.js +++ b/packages/app-rpc/src/Account.js @@ -40,7 +40,6 @@ class Account extends React.PureComponent { render (): React$Node { const { className, defaultValue, isError, style, t } = this.props; - const { publicKey } = this.state; return (
{ type='account' />
- - - + {this.renderNonce()} ); } + renderNonce (): React$Node { + const { t } = this.props; + const { publicKey } = this.state; + + if (!publicKey) { + return null; + } + + return ( + + + + ); + } + onChangeAccount = (publicKey: Uint8Array): void => { const { onChange } = this.props; diff --git a/packages/app-rpc/src/resultToText.js b/packages/app-rpc/src/resultToText.js index 6d4601feb3..79a562a62a 100644 --- a/packages/app-rpc/src/resultToText.js +++ b/packages/app-rpc/src/resultToText.js @@ -10,6 +10,10 @@ import isObject from '@polkadot/util/is/object'; import isU8a from '@polkadot/util/is/u8a'; function resultToText (result: mixed): mixed { + if (result === null || result === undefined) { + return 'null'; + } + if (isU8a(result)) { // $FlowFixMe type has been determined return u8aToHex(result);