Fix spinning rewards counter (#2414)

This commit is contained in:
Jaco Greeff 2020-03-18 10:35:08 +01:00 committed by GitHub
parent b425ebc58e
commit bb911aa9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ function useNextPayouts (onlyLatest?: boolean): [string, BN][] | undefined {
const lastPayouts = allInfo
.map(({ stakingLedger }, index) => [stashIds[index], stakingLedger?.lastReward?.unwrapOr(new BN(-1)).addn(1)])
.filter((value): value is [string, EraIndex] => !!value[1])
.filter(([, era]) => era.lt(prevEra));
.filter(([, era]) => !onlyLatest || era.lt(prevEra));
setNextPayouts(
onlyLatest