From e3422d47776ee2c21e496bb45da17b06f53e8cb4 Mon Sep 17 00:00:00 2001 From: w0rrex <68468180+worrex@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:22:16 +0100 Subject: [PATCH] add epochs to force count (#603) --- components/Pages/Bonding/RewardsComponent.tsx | 6 ++++-- components/Pages/Dashboard/Dashboard.tsx | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/Pages/Bonding/RewardsComponent.tsx b/components/Pages/Bonding/RewardsComponent.tsx index 028aafa3..6adf0cfe 100644 --- a/components/Pages/Bonding/RewardsComponent.tsx +++ b/components/Pages/Bonding/RewardsComponent.tsx @@ -168,6 +168,8 @@ const RewardsComponent = ({ const bondingHasStarted: boolean = useMemo(() => genesisStartTimeInNano / 1_000_000 < Date.now(), [genesisStartTimeInNano]) + const epochsToForce = Math.floor((Date.now() - (Number(currentEpoch?.epoch?.start_time ?? 0) / 1_000_000)) / + (1_000 * 3_600 * 24)) return ( forceEpochAndTakeSnapshots.submit()} > - {'Force Epoch'} + {`Force Epoch (${epochsToForce})`} )} diff --git a/components/Pages/Dashboard/Dashboard.tsx b/components/Pages/Dashboard/Dashboard.tsx index c8a4d516..f939f6b1 100644 --- a/components/Pages/Dashboard/Dashboard.tsx +++ b/components/Pages/Dashboard/Dashboard.tsx @@ -27,8 +27,8 @@ export const Dashboard: FC = () => { const chains = useChainInfos() const prices = usePrices() useEffect(() => { - const fetchDashboardData = async () => { - const circulatingWhaleSupply = dashboardData.supply?.circulating / (10 ** 6) || 0 + const fetchDashboardData = () => { + const circulatingWhaleSupply = (dashboardData.supply?.circulating ?? 0) / (10 ** 6) const marketCap = circulatingWhaleSupply * (prices?.WHALE || 0) || 0 const mappedDashboardData = [] dashboardData.dashboardData?.map((data) => {