From 2d83c335d89d0716f1d8d450cbdabbc61efc308b Mon Sep 17 00:00:00 2001
From: Alex Bueno <44420072+aweell@users.noreply.github.com>
Date: Tue, 26 Nov 2024 12:04:18 +0100
Subject: [PATCH] Fix points calculation
---
.../components/games/higher-or-lower.jsx | 6 +++---
src/pages/advent-calendar-2024/utils/content-config.jsx | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/pages/advent-calendar-2024/components/games/higher-or-lower.jsx b/src/pages/advent-calendar-2024/components/games/higher-or-lower.jsx
index cb34c22679..84c3c0eb6f 100644
--- a/src/pages/advent-calendar-2024/components/games/higher-or-lower.jsx
+++ b/src/pages/advent-calendar-2024/components/games/higher-or-lower.jsx
@@ -45,7 +45,7 @@ export const HigherLowerdataSet2 = [
{ label: "Teams using the design system", value: 108 },
];
-const HigherOrLower = ({ data, onFinish }) => {
+const HigherOrLower = ({ set, data, onFinish }) => {
const [index, setIndex] = useState(0);
const [score, setScore] = useState(0);
const [message, setMessage] = useState("");
@@ -54,7 +54,7 @@ const HigherOrLower = ({ data, onFinish }) => {
useEffect(() => {
const savedGames = JSON.parse(localStorage.getItem("gameScores")) || {};
- const savedGame = savedGames["higherOrLower"];
+ const savedGame = savedGames[`higherOrLower${set}`];
if (savedGame?.completed) {
setScore(savedGame.score);
@@ -98,7 +98,7 @@ const HigherOrLower = ({ data, onFinish }) => {
setIsCorrect(null);
} else {
setStatus("final");
- saveGameData("Higher or lower", score, true);
+ saveGameData(`higherOrLower${set}`, score, true);
}
};
diff --git a/src/pages/advent-calendar-2024/utils/content-config.jsx b/src/pages/advent-calendar-2024/utils/content-config.jsx
index 0090b6e7ba..a865a29d01 100644
--- a/src/pages/advent-calendar-2024/utils/content-config.jsx
+++ b/src/pages/advent-calendar-2024/utils/content-config.jsx
@@ -188,7 +188,7 @@ const contentByDate = {
illustration: ,
illustrationDimmed: ,
content: ({ closeModal }) => (
-
+
),
title: "Higher or Lower",
description:
@@ -237,7 +237,7 @@ const contentByDate = {
illustration: ,
illustrationDimmed: ,
content: ({ closeModal }) => (
-
+
),
title: "Higher or Lower",
description: