Skip to content

Commit

Permalink
Merge pull request #248 from pnodet/patch-1
Browse files Browse the repository at this point in the history
prevent having NaN shown to the user
  • Loading branch information
franciscoBSalgueiro authored Mar 21, 2024
2 parents eb4616d + 8530b0f commit 2215cec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/panels/practice/PracticePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ function PracticePanel({ fen }: { fen: string }) {
thickness={10}
label={
<Text ta="center" px="xs" style={{ pointerEvents: "none" }}>
{Math.round((stats.practiced / stats.total) * 100)}%
{stats.total === 0
? "0%"
: `${Math.round(
(stats.practiced / stats.total) * 100,
)}%`}
</Text>
}
sections={[
Expand Down

0 comments on commit 2215cec

Please sign in to comment.