diff --git a/frontend/src/pages/log-in.ts b/frontend/src/pages/log-in.ts index fc39b5fc..7b51b2b5 100644 --- a/frontend/src/pages/log-in.ts +++ b/frontend/src/pages/log-in.ts @@ -148,15 +148,11 @@ export class LogInPage extends LiteElement { this.formStateService.stop(); } - updated(changedProperties: any) { - if (changedProperties.has("viewState")) { - const route = this.viewState.route; + async updated(changedProperties: any) { + if (changedProperties.get("viewState")) { + await this.updateComplete; - if (route === "login") { - this.formStateService.send("SHOW_SIGN_IN_WITH_PASSWORD"); - } else if (route === "forgotPassword") { - this.formStateService.send("SHOW_FORGOT_PASSWORD"); - } + this.syncFormStateView(); } } @@ -210,6 +206,16 @@ export class LogInPage extends LiteElement { `; } + private syncFormStateView() { + const route = this.viewState.route; + + if (route === "login") { + this.formStateService.send("SHOW_SIGN_IN_WITH_PASSWORD"); + } else if (route === "forgotPassword") { + this.formStateService.send("SHOW_FORGOT_PASSWORD"); + } + } + private renderLoginForm() { let formError;