diff --git a/packages/app-staking/src/Actions/Account/index.tsx b/packages/app-staking/src/Actions/Account/index.tsx index 45442f4b05..988117748e 100644 --- a/packages/app-staking/src/Actions/Account/index.tsx +++ b/packages/app-staking/src/Actions/Account/index.tsx @@ -39,7 +39,8 @@ interface Props extends ApiProps, I18nProps { interface State { controllerId: string | null; destination: number; - hexSessionId: string | null; + hexSessionIdNext: string | null; + hexSessionIdQueue: string | null; isBondExtraOpen: boolean; isInjectOpen: boolean; isNominateOpen: boolean; @@ -86,7 +87,8 @@ class Account extends React.PureComponent { public state: State = { controllerId: null, destination: 0, - hexSessionId: null, + hexSessionIdNext: null, + hexSessionIdQueue: null, isBondExtraOpen: false, isInjectOpen: false, isNominateOpen: false, @@ -116,11 +118,12 @@ class Account extends React.PureComponent { return { controllerId: toIdString(controllerId), destination: rewardDestination && rewardDestination.toNumber(), - hexSessionId: u8aToHex(u8aConcat(...( + hexSessionIdNext: u8aToHex(u8aConcat(...( nextSessionIds.length ? nextSessionIds : sessionIds ).map((id): Uint8Array => id.toU8a())), 48), + hexSessionIdQueue: u8aToHex(u8aConcat(...(sessionIds).map((id): Uint8Array => id.toU8a())), 48), isStashNominating, isStashValidating, nominees: nominators && nominators.map(toIdString), @@ -138,7 +141,7 @@ class Account extends React.PureComponent { public render (): React.ReactNode { const { className, isSubstrateV2, t } = this.props; - const { controllerId, hexSessionId, isBondExtraOpen, isInjectOpen, isStashValidating, isUnbondOpen, nominees, onlineStatus, sessionIds, stashId } = this.state; + const { controllerId, hexSessionIdNext, hexSessionIdQueue, isBondExtraOpen, isInjectOpen, isStashValidating, isUnbondOpen, nominees, onlineStatus, sessionIds, stashId } = this.state; if (!stashId) { return null; @@ -225,7 +228,7 @@ class Account extends React.PureComponent { unlocking: true }} withRewardDestination - withHexSessionId={ isSubstrateV2 && hexSessionId !== '0x' && hexSessionId} + withHexSessionId={ isSubstrateV2 && hexSessionIdNext !== '0x' && [hexSessionIdQueue, hexSessionIdNext]} withValidatorPrefs={isStashValidating} /> @@ -287,7 +290,7 @@ class Account extends React.PureComponent { private renderButtons (): React.ReactNode { const { isSubstrateV2, t } = this.props; - const { controllerId, hexSessionId, isSettingPopupOpen, isStashNominating, isStashValidating, sessionIds } = this.state; + const { controllerId, hexSessionIdNext, isSettingPopupOpen, isStashNominating, isStashValidating, sessionIds } = this.state; const buttons = []; // if we are validating/nominating show stop @@ -307,7 +310,7 @@ class Account extends React.PureComponent { /> ); } else { - if (!sessionIds.length || (isSubstrateV2 && hexSessionId === '0x')) { + if (!sessionIds.length || (isSubstrateV2 && hexSessionIdNext === '0x')) { buttons.push(