diff --git a/src/client/Main.ts b/src/client/Main.ts index b3bf14d05..1300d8789 100644 --- a/src/client/Main.ts +++ b/src/client/Main.ts @@ -832,10 +832,13 @@ class Client { if (window.location.hash === "" || window.location.hash === "#") { history.replaceState(null, "", window.location.origin + "#refresh"); } + const lobbyIdHidden = !this.userSettings.lobbyIdVisibility(); history.pushState( null, "", - `/${config.workerPath(lobby.gameID)}/game/${lobby.gameID}?live`, + lobbyIdHidden + ? "/streamer-mode" + : `/${config.workerPath(lobby.gameID)}/game/${lobby.gameID}?live`, ); // Store current URL for popstate confirmation @@ -848,7 +851,10 @@ class Client { lobbyId: string, config: Awaited>, ) { - const targetUrl = `/${config.workerPath(lobbyId)}/game/${lobbyId}`; + const lobbyIdHidden = !this.userSettings.lobbyIdVisibility(); + const targetUrl = lobbyIdHidden + ? "/streamer-mode" + : `/${config.workerPath(lobbyId)}/game/${lobbyId}`; const currentUrl = window.location.pathname; if (currentUrl !== targetUrl) {