Replace loggedEmail with this.emailFormControl.value.

This commit is contained in:
Alec Rippberger 2024-10-18 09:30:21 -05:00
parent b5cdf4d6f7
commit a49c4458d3
No known key found for this signature in database
GPG Key ID: 9DD8DA583B28154A
1 changed files with 8 additions and 7 deletions

View File

@ -98,10 +98,6 @@ export class LoginComponent implements OnInit, OnDestroy {
return this.formGroup.controls.email; return this.formGroup.controls.email;
} }
get loggedEmail(): string {
return this.formGroup.value.email;
}
get uiState(): LoginUiState { get uiState(): LoginUiState {
return this.validatedEmail ? LoginUiState.MASTER_PASSWORD_ENTRY : LoginUiState.EMAIL_ENTRY; return this.validatedEmail ? LoginUiState.MASTER_PASSWORD_ENTRY : LoginUiState.EMAIL_ENTRY;
} }
@ -476,12 +472,17 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
private focusInput() { private focusInput() {
const email = this.loggedEmail; document
document.getElementById(email == null || email === "" ? "email" : "masterPassword")?.focus(); .getElementById(
this.emailFormControl.value == null || this.emailFormControl.value === ""
? "email"
: "masterPassword",
)
?.focus();
} }
private async defaultOnInit(): Promise<void> { private async defaultOnInit(): Promise<void> {
await this.getLoginWithDevice(this.loggedEmail); await this.getLoginWithDevice(this.emailFormControl.value);
// If there's an existing org invite, use it to get the password policies // If there's an existing org invite, use it to get the password policies
const orgPolicies = await this.loginComponentService.getOrgPolicies(); const orgPolicies = await this.loginComponentService.getOrgPolicies();