From ef879020867ea405462aaa87da99707d25a47595 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Tue, 4 Aug 2026 14:40:16 +0530 Subject: [PATCH] fix: resolve 4 bugs in GameHub --- frontend/public/games/Flappy Block/script.js | 2 +- frontend/public/games/glow-drops/script.js | 2 +- frontend/public/scripts/minesweeper.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/public/games/Flappy Block/script.js b/frontend/public/games/Flappy Block/script.js index af98699f..ff18492c 100644 --- a/frontend/public/games/Flappy Block/script.js +++ b/frontend/public/games/Flappy Block/script.js @@ -54,7 +54,7 @@ function update() { pipes.splice(i, 1); createPipe(); score++; - document.getElementById("score").innerText = `Score: ${score}`; + document.getElementById("score").textContent = `Score: ${score}`; } if (block.x < pipe.x + pipe.width && diff --git a/frontend/public/games/glow-drops/script.js b/frontend/public/games/glow-drops/script.js index d3e389b1..75aeca3c 100644 --- a/frontend/public/games/glow-drops/script.js +++ b/frontend/public/games/glow-drops/script.js @@ -52,7 +52,7 @@ function playBgMusic() { if (!audioCtx) return; - if (bgAudio) { bgAudio.play().catch(()=>{}); return; } + if (bgAudio) { bgAudio.play().catch( => console.error()); return; } bgAudio = new Audio(bgMusicUrl); bgAudio.loop = true; bgAudio.crossOrigin = 'anonymous'; 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); });