From 21362ba12566d5b693bcc2cc3eaa9f5ecb1e4812 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Sun, 22 Feb 2026 16:47:43 -0500 Subject: [PATCH] Fix pair chime not playing for local player's own swaps The swap animation defers state updates to pendingGameState, which bypassed checkForNewPairs entirely. Now pair detection runs when the deferred state is applied after the swap animation completes. Co-Authored-By: Claude Opus 4.6 --- client/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/app.js b/client/app.js index c0e81d8..f1b1cdc 100644 --- a/client/app.js +++ b/client/app.js @@ -1573,8 +1573,10 @@ class GolfGame { this.heldCardFloating.classList.add('hidden'); if (this.pendingGameState) { + const oldState = this.gameState; this.gameState = this.pendingGameState; this.pendingGameState = null; + this.checkForNewPairs(oldState, this.gameState); this.renderGame(); } } @@ -2592,7 +2594,6 @@ class GolfGame { if (!wasPaired && nowPaired) { // New pair formed! - console.log('[PAIR] New pair detected for', newPlayer.name, 'col', top, bottom, 'isLocal:', newPlayer.id === this.playerId); setTimeout(() => { this.firePairCelebration(newPlayer.id, top, bottom); }, window.TIMING?.celebration?.pairDelay || 50);