Skip to content

Commit

Permalink
Merge pull request #96 from availproject/ghali/fix-payout
Browse files Browse the repository at this point in the history
other fixes
  • Loading branch information
Leouarz authored Nov 12, 2024
2 parents 4746a79 + 4f492ab commit 792f148
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/page-staking/src/Payouts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ function groupByValidator (allRewards: Record<string, DeriveStakerReward[]>): Pa
});
}

entry.available = entry.available.add(value);
if (!reward.isClaimed) {
entry.available = entry.available.add(value);
}

entry.total = entry.total.add(total);
} else {
grouped.push({
available: value,
available: !reward.isClaimed ? value : new BN(0),
eras: [{
era: reward.era,
isClaimed: reward.isClaimed,
Expand Down Expand Up @@ -241,7 +244,7 @@ function Payouts ({ className = '', historyDepth, isInElection, ownPools, ownVal
<PayButton
isAll
isDisabled={isInElection}
payout={validators}
payout={validators?.filter((x) => x.eras.some((y) => !y.isClaimed))}
/>
</Button.Group>
<ElectionBanner isInElection={isInElection} />
Expand Down

0 comments on commit 792f148

Please sign in to comment.