This reverts commit 824bf2f61c.
This commit is contained in:
parent
5369ff6b0b
commit
393b068f85
@ -4,7 +4,7 @@
|
||||
|
||||
import { DeriveStakingOverview } from '@polkadot/api-derive/types';
|
||||
import { AppProps as Props } from '@polkadot/react-components/types';
|
||||
import { ElectionStatus, Forcing } from '@polkadot/types/interfaces';
|
||||
import { ElectionStatus } from '@polkadot/types/interfaces';
|
||||
|
||||
import React, { useEffect, useMemo, useReducer, useState } from 'react';
|
||||
import { Route, Switch } from 'react-router';
|
||||
@ -44,12 +44,9 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement<Pr
|
||||
const ownStashes = useOwnStashInfos();
|
||||
const targets = useSortedTargets();
|
||||
const stakingOverview = useCall<DeriveStakingOverview>(api.derive.staking.overview, []);
|
||||
const isInElection = useCall<boolean>(api.query.staking.eraElectionStatus, [], {
|
||||
const isInElection = useCall<boolean>(api.query.staking?.eraElectionStatus, [], {
|
||||
transform: (status: ElectionStatus) => status.isOpen
|
||||
});
|
||||
const isPOA = useCall<boolean>(api.query.staking.forceEra, [], {
|
||||
transform: (forcing: Forcing) => forcing.isForceNone
|
||||
});
|
||||
const [nominators, dispatchNominators] = useReducer(reduceNominators, [] as string[]);
|
||||
const hasQueries = useMemo(
|
||||
(): boolean =>
|
||||
@ -145,7 +142,7 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement<Pr
|
||||
</Switch>
|
||||
<Actions
|
||||
className={pathname === `${basePath}/actions` ? '' : 'staking--hidden'}
|
||||
isInElection={isInElection && !isPOA}
|
||||
isInElection={isInElection}
|
||||
next={next}
|
||||
ownStashes={ownStashes}
|
||||
targets={targets}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user