From 7d385806dfae66da94399cc2690669ef2cebc1bc Mon Sep 17 00:00:00 2001 From: Josue Zamudio Date: Sat, 21 Mar 2026 04:30:09 +0000 Subject: [PATCH] Fix ready button state after game over - Enable ready button in resetLobbyState() so players can ready up - Remove redundant ready button state reset from endGame() - Ensure ready button is enabled when returning to lobby Co-Authored-By: Claude Opus 4.6 --- public/js/app.js | 4 ---- public/js/ui.js | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 7d5332a..c20644e 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -229,10 +229,6 @@ function endGame(states) { network.isSpectator = false; ui.hideSpectatorMode(); - // Reset ready button state - ui.buttons.ready.textContent = 'READY'; - ui.buttons.ready.disabled = true; - ui.showGameOver(winner, scores); } diff --git a/public/js/ui.js b/public/js/ui.js index 18b4914..b23bbe5 100644 --- a/public/js/ui.js +++ b/public/js/ui.js @@ -81,13 +81,14 @@ class UIManager { handleBackToLobby() { this.hideGameOver(); this.resetLobbyState(); + this.buttons.ready.disabled = false; this.showScreen('room'); } resetLobbyState() { // Reset ready button to default state this.buttons.ready.textContent = 'READY'; - this.buttons.ready.disabled = true; + this.buttons.ready.disabled = false; // Clear player and spectator lists this.displays.playerList.innerHTML = '';