Fix useSortedTargets flags for claimedRewards (#10554)

This commit is contained in:
Tarik Gul 2024-05-08 20:13:14 -07:00 committed by GitHub
parent 805efe1dc4
commit ff9af34173
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,7 +36,7 @@ interface OldLedger {
}
const EMPTY_PARTIAL: Partial<SortedTargets> = {};
const DEFAULT_FLAGS_ELECTED = { withClaimedRewardsEras: true, withController: true, withExposure: true, withExposureMeta: true, withPrefs: true };
const DEFAULT_FLAGS_ELECTED = { withController: true, withExposure: true, withExposureMeta: true, withPrefs: true };
const DEFAULT_FLAGS_WAITING = { withController: true, withPrefs: true };
const OPT_ERA = {
@ -300,8 +300,8 @@ function useSortedTargetsImpl (favorites: string[], withLedger: boolean): Sorted
api.query.staking.minValidatorBond,
api.query.balances?.totalIssuance
], OPT_MULTI);
const electedInfo = useCall<DeriveStakingElected>(api.derive.staking.electedInfo, [{ ...DEFAULT_FLAGS_ELECTED, withLedger }]);
const waitingInfo = useCall<DeriveStakingWaiting>(api.derive.staking.waitingInfo, [{ ...DEFAULT_FLAGS_WAITING, withLedger }]);
const electedInfo = useCall<DeriveStakingElected>(api.derive.staking.electedInfo, [{ ...DEFAULT_FLAGS_ELECTED, withClaimedRewardsEras: withLedger, withLedger }]);
const waitingInfo = useCall<DeriveStakingWaiting>(api.derive.staking.waitingInfo, [{ ...DEFAULT_FLAGS_WAITING, withClaimedRewardsEras: withLedger, withLedger }]);
const lastEraInfo = useCall<LastEra>(api.derive.session.info, undefined, OPT_ERA);
const baseInfo = useMemo(