From 83c40116afb1c0c08576d9774e46eb9e45471d0c Mon Sep 17 00:00:00 2001 From: funman300 Date: Mon, 18 May 2026 18:59:51 -0700 Subject: [PATCH] fix(web): freeze timer when auto-complete begins (closes #4) The game timer kept counting during the auto-complete animation even though the player had already made their last decision. stopTimer() is now called the moment is_auto_completable fires so elapsed_seconds reflects only real play time, not the animation delay. Co-Authored-By: Claude Sonnet 4.6 --- solitaire_server/web/game.js | 1 + 1 file changed, 1 insertion(+) diff --git a/solitaire_server/web/game.js b/solitaire_server/web/game.js index 17ee075..9ab51ef 100644 --- a/solitaire_server/web/game.js +++ b/solitaire_server/web/game.js @@ -300,6 +300,7 @@ function render(s) { board.querySelectorAll(".card.drop-target").forEach(e => e.classList.remove("drop-target")); if (s.is_auto_completable && !s.is_won && !acTimer) { + stopTimer(); // freeze elapsed time at the moment the player's last move completes acTimer = setInterval(doAutoCompleteStep, 380); } if (s.is_won) {