mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-26 23:24:36 +00:00
bugfix: hide language button when starting game
This commit is contained in:
@@ -20,6 +20,7 @@ export class LangSelector extends LitElement {
|
||||
@state() private languageList: any[] = [];
|
||||
@state() private showModal: boolean = false;
|
||||
@state() private debugMode: boolean = false;
|
||||
@state() isVisible = true;
|
||||
|
||||
private debugKeyPressed: boolean = false;
|
||||
private languageMetadata: LanguageMetadata[] = metadata;
|
||||
@@ -248,7 +249,16 @@ export class LangSelector extends LitElement {
|
||||
await this.loadLanguageList();
|
||||
}
|
||||
|
||||
public close() {
|
||||
this.showModal = false;
|
||||
this.isVisible = false;
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.isVisible) {
|
||||
return html``;
|
||||
}
|
||||
const currentLang =
|
||||
this.languageList.find((l) => l.code === this.currentLang) ??
|
||||
(this.currentLang === "debug"
|
||||
|
||||
@@ -560,6 +560,7 @@ class Client {
|
||||
"stats-button",
|
||||
"token-login",
|
||||
"matchmaking-modal",
|
||||
"lang-selector",
|
||||
].forEach((tag) => {
|
||||
const modal = document.querySelector(tag) as HTMLElement & {
|
||||
close?: () => void;
|
||||
|
||||
Reference in New Issue
Block a user