Skip to content

Commit

Permalink
dont show 0 paid rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
mrq1911 committed Jan 9, 2024
1 parent ca3fbf9 commit d1f2216
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/handlers/staking.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ async function unstakeHandler({event, siblings}) {
}

async function rewardsClaimedHandler({event: {data: {who, paidRewards, slashedUnpaidRewards}}}) {
const message = `${formatAccount(who, false, emojify(who))} claimed **${formatAmount(hdx(paidRewards))}** and forfeited **${formatAmount(hdx(slashedUnpaidRewards))}**`;
broadcast(message);
if (Number(paidRewards) > 0) {
const message = `${formatAccount(who, false, emojify(who))} claimed **${formatAmount(hdx(paidRewards))}** and forfeited **${formatAmount(hdx(slashedUnpaidRewards))}**`;
broadcast(message);
}
}

0 comments on commit d1f2216

Please sign in to comment.