Fix singleplayer check (#1260)

## Description:

Fix a broken check for singleplayer that relied on the `any` type to
mask undefined field access.

## 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
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
Scott Anderson
2025-06-23 12:42:22 -04:00
committed by GitHub
parent 5c4692bc29
commit 06b18892e4
+3 -3
View File
@@ -327,8 +327,8 @@ class Client {
}
}
private async handleJoinLobby(event: CustomEvent) {
const lobby = event.detail as JoinLobbyEvent;
private async handleJoinLobby(event: CustomEvent<JoinLobbyEvent>) {
const lobby = event.detail;
console.log(`joining lobby ${lobby.gameID}`);
if (this.gameStop !== null) {
console.log("joining lobby, stopping existing game");
@@ -403,7 +403,7 @@ class Client {
(ad as HTMLElement).style.display = "none";
});
if (event.detail.gameConfig?.gameType !== GameType.Singleplayer) {
if (lobby.gameStartInfo?.config.gameType !== GameType.Singleplayer) {
history.pushState(null, "", `#join=${lobby.gameID}`);
}
},