diff --git a/src/client/Main.ts b/src/client/Main.ts index cfadf1c9a..82f5c516a 100644 --- a/src/client/Main.ts +++ b/src/client/Main.ts @@ -922,7 +922,11 @@ class Client { } private async handleLeaveLobby(/* event: CustomEvent */) { + // Abort any in-progress join attempt (before joinLobby() was called) + this.joinAttemptId++; + if (this.gameStop === null) { + console.log("leaving lobby, no active game to stop"); return; } console.log("leaving lobby, cancelling game");