From 4e9b7172507e6421e3e313ae0260b88f96b2c3f9 Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:37:07 +0200 Subject: [PATCH] Update components/dashboard/RecentZapsCard.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- components/dashboard/RecentZapsCard.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/dashboard/RecentZapsCard.tsx b/components/dashboard/RecentZapsCard.tsx index aab7971..742b998 100644 --- a/components/dashboard/RecentZapsCard.tsx +++ b/components/dashboard/RecentZapsCard.tsx @@ -22,6 +22,9 @@ export function RecentZapsCard({ zaps }: { zaps: Array }) { }); let percentages: { [key: string]: number } = {}; + if (totalWeight === 0) { + return percentages; // Return an empty object if totalWeight is zero + } for (let receiver in weights) { percentages[receiver] = (weights[receiver] / totalWeight) * 100; }