aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/Gaming/Score.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components/Gaming/Score.tsx')
-rw-r--r--frontend/app/components/Gaming/Score.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/app/components/Gaming/Score.tsx b/frontend/app/components/Gaming/Score.tsx
index 9b6283f..b4a415c 100644
--- a/frontend/app/components/Gaming/Score.tsx
+++ b/frontend/app/components/Gaming/Score.tsx
@@ -13,8 +13,8 @@ export default function Score({ status, score }: Props) {
if (status === "running") {
intervalId = setInterval(() => {
- const maxValue = Math.pow(10, String(score).length) - 1;
- const minValue = Math.pow(10, String(score).length - 1);
+ const maxValue = Math.pow(10, String(score ?? 100).length) - 1;
+ const minValue = Math.pow(10, String(score ?? 100).length - 1);
const randomValue =
Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;
setDisplayScore(randomValue);