Skip to content

Commit

Permalink
fix: fixed amount of mints in leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleySuira committed Apr 26, 2024
1 parent f6d44cb commit 0d84b34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export default function Leaderboard() {
const frame = frames.find(
(item) => item.nftTokenAddress === curr
);
prev[frame?.collectiveName?.toLowerCase() || ""] = amount;
if(prev[frame?.collectiveName?.toLowerCase()]) {
const prevAmount = prev[frame?.collectiveName?.toLowerCase()];
prev[frame?.collectiveName?.toLowerCase()] = prevAmount + amount;
} else {
prev[frame?.collectiveName?.toLowerCase()] = amount;
}
return prev;
}, {});
setOwners(_owners);
Expand Down

0 comments on commit 0d84b34

Please sign in to comment.