From 10a08f28f36f3b7c1462c326aa86dfd457fea076 Mon Sep 17 00:00:00 2001 From: keyan Date: Mon, 1 Apr 2024 09:05:39 -0500 Subject: [PATCH] fix total rewards --- pages/rewards/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/rewards/index.js b/pages/rewards/index.js index a448dab5..27a1fadc 100644 --- a/pages/rewards/index.js +++ b/pages/rewards/index.js @@ -99,16 +99,17 @@ export default function Rewards ({ ssrData }) { let { rewards: [{ total, sources, time, leaderboard }] } = useData(data, ssrData) if (rewardsData?.rewards?.length > 0) { - total = rewardsData.rewards[0].total - 1000000 > 0 ? rewardsData.rewards[0].total - 1000000 : 0 + total = rewardsData.rewards[0].total sources = rewardsData.rewards[0].sources time = rewardsData.rewards[0].time } function EstimatedReward ({ rank }) { + const totalRest = total - 1000000 return (
- estimated reward: {numWithUnits(rank === 1 ? 1000000 : Math.floor(total * proportions[rank - 2]))} + estimated reward: {numWithUnits(rank === 1 ? 1000000 : Math.floor(totalRest * proportions[rank - 2]))}
)