Skip to content

Commit

Permalink
fix stats on 0 value
Browse files Browse the repository at this point in the history
  • Loading branch information
nibty committed May 10, 2024
1 parent 3c9ab64 commit c6518dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function Leaderboard() {
}, [searchParams]);

const totalSupplyValue = () => {
if (!totalSupply?.points) {
if (isNaN(totalSupply?.points)) {
return null;
}
return Intl.NumberFormat("en-US").format(
Expand All @@ -90,35 +90,35 @@ export default function Leaderboard() {
};

const totalHashesValue = () => {
if (!totalSupply?.hashes) {
if (isNaN(totalSupply?.hashes)) {
return null;
}
return Intl.NumberFormat("en-US").format(totalSupply?.hashes);
};

const totalSuperHashesValue = () => {
if (!totalSupply?.superHashes) {
if (isNaN(totalSupply?.superHashes)) {
return null;
}
return Intl.NumberFormat("en-US").format(totalSupply?.superHashes);
};

const txsValue = () => {
if (!totalSupply?.txs) {
if (isNaN(totalSupply?.txs)) {
return null;
}
return Intl.NumberFormat("en-US").format(totalSupply?.txs);
};

const ampValue = () => {
if (!totalSupply?.amp) {
if (isNaN(totalSupply?.amp)) {
return null;
}
return Intl.NumberFormat("en-US").format(totalSupply?.amp);
};

const lastAmpSlotValue = () => {
if (!totalSupply?.lastAmpSlot) {
if (isNaN(totalSupply?.lastAmpSlot)) {
return null;
}
return Intl.NumberFormat("en-US").format(totalSupply?.lastAmpSlot);
Expand Down

0 comments on commit c6518dc

Please sign in to comment.