diff --git a/packages/app-staking/src/Account/index.tsx b/packages/app-staking/src/Account/index.tsx index 8e24388e55..ea64dc0eee 100644 --- a/packages/app-staking/src/Account/index.tsx +++ b/packages/app-staking/src/Account/index.tsx @@ -35,7 +35,6 @@ type Props = ApiProps & I18nProps & { }; type State = { - isAccountValidating: boolean, isBondingOpen: boolean, isNominateOpen: boolean, isSessionKeyOpen: boolean, @@ -48,7 +47,6 @@ type State = { class Account extends React.PureComponent { state: State = { - isAccountValidating: false, isBondingOpen: false, isSessionKeyOpen: false, isNominateOpen: false, @@ -59,12 +57,11 @@ class Account extends React.PureComponent { stashId: null }; - static getDerivedStateFromProps ({ accountId, session_nextKeyFor, staking_bonded, staking_ledger, validators }: Props): Partial { + static getDerivedStateFromProps ({ session_nextKeyFor, staking_bonded, staking_ledger }: Props): Partial { // console.error('staking_stakers', JSON.stringify(staking_stakers)); return { - isAccountValidating: validators.indexOf(accountId) !== -1, bondedId: staking_bonded && staking_bonded.isSome ? staking_bonded.unwrap().toString() : null, @@ -279,7 +276,7 @@ class Account extends React.PureComponent { private renderButtons () { const { accountId, intentions, t } = this.props; - const { isAccountValidating, sessionId, stashId } = this.state; + const { sessionId, stashId } = this.state; const buttons = []; if (!stashId) { @@ -303,55 +300,36 @@ class Account extends React.PureComponent { ); } } else { - if (isAccountValidating) { + const nominees = this.getNominees(); + const isNominating = nominees && nominees.length; + const isValidating = stashId && intentions.indexOf(stashId) !== -1; + + if (isValidating || isNominating) { buttons.push( ); } else { - const nominees = this.getNominees(); - const hasNominees = nominees && nominees.length; - const isValidating = stashId && intentions.indexOf(stashId) !== -1; - - if (!hasNominees) { - buttons.push( -