From 3cea5379574c27585371c242b1989bfd38e660a3 Mon Sep 17 00:00:00 2001 From: LewisB Date: Thu, 5 Dec 2024 21:40:00 +0100 Subject: [PATCH] fix: cannot convert to bigint --- packages/app/src/hooks/useTotalStats.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/app/src/hooks/useTotalStats.ts b/packages/app/src/hooks/useTotalStats.ts index 6df098ee..295da7a7 100644 --- a/packages/app/src/hooks/useTotalStats.ts +++ b/packages/app/src/hooks/useTotalStats.ts @@ -16,7 +16,10 @@ export const useTotalStats = (): TotalStats | undefined => { const stats = useSubgraphTotalStats(); return useMemo(() => { - const totalDonations = stats?.collectives?.reduce((acc, collective) => acc + Number(collective.totalDonations), 0); + const totalDonations = stats?.collectives?.reduce( + (acc, collective) => BigInt(acc + BigInt(collective.totalDonations)), + BigInt(0) + ); const donationsFormatted = formatGoodDollarAmount(totalDonations?.toString() ?? '0', 2); return {