Skip to content

Commit

Permalink
fix: cannot convert to bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
L03TJ3 committed Dec 5, 2024
1 parent 21d2bfa commit 3cea537
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/app/src/hooks/useTotalStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3cea537

Please sign in to comment.