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`