From aeb1b2da594dc2254af75a4b22be2413bf5f3644 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 12:26:48 +0530 Subject: [PATCH] fix: resolve 4 bugs in GameHub --- frontend/public/scripts/minesweeper.js | 2 +- frontend/public/scripts/simon.js | 2 +- frontend/public/scripts/sudoku.js | 2 +- frontend/src/components/Backgrounds/GridScan.jsx | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/public/scripts/minesweeper.js b/frontend/public/scripts/minesweeper.js index a87f3deb..de3b9236 100644 --- a/frontend/public/scripts/minesweeper.js +++ b/frontend/public/scripts/minesweeper.js @@ -329,7 +329,7 @@ class Minesweeper { // Restore board content document.querySelectorAll('.cell').forEach(cell => { cell.style.background = cell.style.originalBackground || ''; - const row = parseInt(cell.dataset.row); + const row = parseInt(cell.dataset.row, 10); const col = parseInt(cell.dataset.col); this.updateCellDisplay(row, col); }); diff --git a/frontend/public/scripts/simon.js b/frontend/public/scripts/simon.js index 7afed7fc..85df0fe7 100644 --- a/frontend/public/scripts/simon.js +++ b/frontend/public/scripts/simon.js @@ -2,7 +2,7 @@ let sequence = []; let playerSequence = []; let level = 1; -let highScore = parseInt(localStorage.getItem('simonHighScore')) || 0; +let highScore = parseInt(localStorage.getItem('simonHighScore', 10)) || 0; let gameActive = false; let showingSequence = false; let inputLocked = false; diff --git a/frontend/public/scripts/sudoku.js b/frontend/public/scripts/sudoku.js index 72c98737..815de8fd 100644 --- a/frontend/public/scripts/sudoku.js +++ b/frontend/public/scripts/sudoku.js @@ -104,7 +104,7 @@ function handleKeyPress(e) { const key = e.key; if (key >= '1' && key <= '9') { - inputNumber(parseInt(key)); + inputNumber(parseInt(key, 10)); } else if (key === 'Delete' || key === 'Backspace') { clearCell(); } diff --git a/frontend/src/components/Backgrounds/GridScan.jsx b/frontend/src/components/Backgrounds/GridScan.jsx index 26a68ef9..1cc00dce 100644 --- a/frontend/src/components/Backgrounds/GridScan.jsx +++ b/frontend/src/components/Backgrounds/GridScan.jsx @@ -891,3 +891,5 @@ function dist2(a, b) { } export default GridScan; + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file