From f5cba9a495acf867c774328adeeb1fe775af8978 Mon Sep 17 00:00:00 2001 From: Aotumuri Date: Tue, 3 Feb 2026 22:26:47 +0900 Subject: [PATCH] fix: remove incorrect host display in JoinLobbyModal (Public game) (#3099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Hide the host badge when joining public lobbies before スクリーンショット 2026-02-03 21 45 45 after スクリーンショット 2026-02-03 21 44 00 ## 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: aotumuri --- src/client/JoinLobbyModal.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/JoinLobbyModal.ts b/src/client/JoinLobbyModal.ts index 20e0e79b0..59ee5b48a 100644 --- a/src/client/JoinLobbyModal.ts +++ b/src/client/JoinLobbyModal.ts @@ -55,6 +55,10 @@ export class JoinLobbyModal extends BaseModal { private countdownTimerId: number | null = null; private handledJoinTimeout = false; + private isPrivateLobby(): boolean { + return this.gameConfig?.gameType === GameType.Private; + } + private readonly handleLobbyInfo = (event: LobbyInfoEvent) => { const lobby = event.lobby; if (!this.currentLobbyId || lobby.gameID !== this.currentLobbyId) { @@ -91,6 +95,9 @@ export class JoinLobbyModal extends BaseModal { : translateText("public_lobby.started"); const maxPlayers = this.gameConfig?.maxPlayers ?? 0; const playerCount = this.playerCount; + const hostClientID = this.isPrivateLobby() + ? (this.lobbyCreatorClientID ?? "") + : ""; const content = html`
this.closeAndLeave(), ariaLabel: translateText("common.close"), rightContent: - this.currentLobbyId && - this.gameConfig?.gameType === GameType.Private + this.currentLobbyId && this.isPrivateLobby() ? html` ` @@ -129,7 +135,7 @@ export class JoinLobbyModal extends BaseModal { class="mt-6" .gameMode=${this.gameConfig?.gameMode ?? GameMode.FFA} .clients=${this.players} - .lobbyCreatorClientID=${this.lobbyCreatorClientID} + .lobbyCreatorClientID=${hostClientID} .currentClientID=${this.currentClientID} .teamCount=${this.gameConfig?.playerTeams ?? 2} .nationCount=${this.nationCount} @@ -143,7 +149,7 @@ export class JoinLobbyModal extends BaseModal { `}
- ${this.gameConfig?.gameType === GameType.Private + ${this.isPrivateLobby() ? html`