diff --git a/packages/app-staking/src/Account/SessionKey.tsx b/packages/app-staking/src/Account/SessionKey.tsx index 2ccd1d2f33..5328fad699 100644 --- a/packages/app-staking/src/Account/SessionKey.tsx +++ b/packages/app-staking/src/Account/SessionKey.tsx @@ -16,11 +16,19 @@ type Props = I18nProps & { }; type State = { - sessionId?: string + sessionId: string }; class Key extends React.PureComponent { - state: State = {}; + state: State; + + constructor (props: Props) { + super(props); + + this.state = { + sessionId: props.accountId + }; + } render () { const { accountId, isOpen, onClose, t } = this.props; @@ -62,15 +70,21 @@ class Key extends React.PureComponent { } private renderContent () { - const { t } = this.props; + const { accountId, t } = this.props; const { sessionId } = this.state; return ( <> - {t('Key Preferences')} + {t('Session Key')} + {
{this.renderButtons()} {this.renderBondedId()} - {this.renderSessionId()} {this.renderStashId()} + {this.renderSessionId()} {this.renderNominee()} {this.renderNominators()}
@@ -173,6 +173,7 @@ class Account extends React.PureComponent { } private renderNominee () { + const { t } = this.props; const nominees = this.getNominees(); if (!nominees || !nominees.length) { @@ -181,7 +182,7 @@ class Account extends React.PureComponent { return (
- + { nominees.map((nomineeId, index) => ( { } private renderBondedId () { + const { t } = this.props; const { bondedId } = this.state; if (!bondedId) { @@ -228,16 +230,14 @@ class Account extends React.PureComponent { return (
- - + +
); } private renderSessionId () { + const { t } = this.props; const { sessionId } = this.state; if (!sessionId) { @@ -246,16 +246,14 @@ class Account extends React.PureComponent { return (
- - + +
); } private renderStashId () { + const { t } = this.props; const { stashId } = this.state; if (!stashId) { @@ -264,11 +262,8 @@ class Account extends React.PureComponent { return (
- - + +
); } @@ -305,7 +300,7 @@ class Account extends React.PureComponent { isPrimary key='bond' onClick={this.toggleBonding} - label={t('Bond')} + label={t('Bond Funds')} /> ); } else { @@ -316,16 +311,7 @@ class Account extends React.PureComponent { const isNominating = nominees && nominees.length; const isValidating = intentions.indexOf(accountId) !== -1; - if (!sessionId) { - buttons.push( -