Route all lobby transitions through showLobby() for animation cleanup

game_ended, queue_left, and cancelMatchmaking were calling
showScreen('lobby') directly, bypassing the cancelAll() cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken 2026-02-22 21:12:39 -05:00
parent 56305424ff
commit 9a313fce80

View File

@ -950,7 +950,7 @@ class GolfGame {
// Host ended the game or player was kicked // Host ended the game or player was kicked
this._intentionalClose = true; this._intentionalClose = true;
if (this.ws) this.ws.close(); if (this.ws) this.ws.close();
this.showScreen('lobby'); this.showLobby();
if (data.reason) { if (data.reason) {
this.showError(data.reason); this.showError(data.reason);
} }
@ -975,7 +975,7 @@ class GolfGame {
case 'queue_left': case 'queue_left':
this.stopMatchmakingTimer(); this.stopMatchmakingTimer();
this.showScreen('lobby'); this.showLobby();
break; break;
case 'error': case 'error':
@ -995,7 +995,7 @@ class GolfGame {
cancelMatchmaking() { cancelMatchmaking() {
this.send({ type: 'queue_leave' }); this.send({ type: 'queue_leave' });
this.stopMatchmakingTimer(); this.stopMatchmakingTimer();
this.showScreen('lobby'); this.showLobby();
} }
startMatchmakingTimer() { startMatchmakingTimer() {