mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 07:55:58 +00:00
bugfix: hide account button and token modal login on game start (#1986)
## Description: The account button persisted after game starting ## 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: evan
This commit is contained in:
@@ -235,6 +235,8 @@ export class AccountButton extends LitElement {
|
||||
@state() private loggedInEmail: string | null = null;
|
||||
@state() private loggedInDiscord: string | null = null;
|
||||
|
||||
private isVisible = true;
|
||||
|
||||
@query("account-modal") private recoveryModal: AccountModal;
|
||||
|
||||
constructor() {
|
||||
@@ -266,6 +268,10 @@ export class AccountButton extends LitElement {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.isVisible) {
|
||||
return html``;
|
||||
}
|
||||
|
||||
let buttonTitle = "";
|
||||
if (this.loggedInEmail) {
|
||||
buttonTitle = translateText("account_modal.logged_in_as", {
|
||||
@@ -313,4 +319,10 @@ export class AccountButton extends LitElement {
|
||||
private open() {
|
||||
this.recoveryModal?.open();
|
||||
}
|
||||
|
||||
public close() {
|
||||
this.isVisible = false;
|
||||
this.recoveryModal?.close();
|
||||
this.requestUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,6 +528,8 @@ class Client {
|
||||
"language-modal",
|
||||
"news-modal",
|
||||
"flag-input-modal",
|
||||
"account-button",
|
||||
"token-login",
|
||||
].forEach((tag) => {
|
||||
const modal = document.querySelector(tag) as HTMLElement & {
|
||||
close?: () => void;
|
||||
|
||||
Reference in New Issue
Block a user