From 4e126c2e796ca4d6c3943ac192dd394c2665a09e Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:26:57 +0100 Subject: [PATCH] =?UTF-8?q?Maybe=20for=20v30:=20Add=20leave=20confirmation?= =?UTF-8?q?=20dialog=20to=20JoinLobbyModal=20=F0=9F=9A=AA=20(#3507)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Adds a `confirmBeforeClose()` override to `JoinLobbyModal`, matching the existing behavior in `HostLobbyModal`. Because the german streamers had a lot of problems with accidentally leaving today. When a user is in a lobby and tries to close the modal (Escape key or clicking outside), they now get a confirmation dialog asking if they really want to leave. If the user hasn't joined a lobby yet (still on the join form), the modal closes without prompting. Reuses the existing `host_modal.leave_confirmation` translation key. ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin --- src/client/JoinLobbyModal.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client/JoinLobbyModal.ts b/src/client/JoinLobbyModal.ts index c389ceb06..f4692a0d1 100644 --- a/src/client/JoinLobbyModal.ts +++ b/src/client/JoinLobbyModal.ts @@ -374,6 +374,11 @@ export class JoinLobbyModal extends BaseModal { ); } + public confirmBeforeClose(): boolean { + if (!this.currentLobbyId) return true; + return confirm(translateText("host_modal.leave_confirmation")); + } + protected onClose(): void { this.clearCountdownTimer(); this.stopLobbyUpdates();