mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 18:44:23 +00:00
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:
+3
-3
@@ -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}`);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user