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:
evanpelle
2025-09-01 11:34:42 -07:00
committed by GitHub
parent d655d0368e
commit acd65e3371
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -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();
}
}
+2
View File
@@ -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;