diff --git a/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.html b/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.html index 854ff814262..bebe6eb1c87 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.html @@ -7,7 +7,7 @@ diff --git a/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.ts index 6f3d02c06fa..c4015e3bc63 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/account-recovery/account-recovery-dialog.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from "@angular/common"; -import { Component, Inject, OnInit, ViewChild } from "@angular/core"; -import { firstValueFrom } from "rxjs"; +import { Component, Inject, ViewChild } from "@angular/core"; +import { switchMap } from "rxjs"; import { InputPasswordComponent, @@ -79,7 +79,7 @@ type AccountRecoveryDialogResultType = InputPasswordComponent, ], }) -export class AccountRecoveryDialogComponent implements OnInit { +export class AccountRecoveryDialogComponent { @ViewChild(InputPasswordComponent) inputPasswordComponent!: InputPasswordComponent; @@ -88,6 +88,11 @@ export class AccountRecoveryDialogComponent implements OnInit { receivedPasswordInputResult = false; submitting = false; + masterPasswordPolicyOptions$ = this.accountService.activeAccount$.pipe( + getUserId, + switchMap((userId) => this.policyService.masterPasswordPolicyOptions$(userId)), + ); + get loggedOutWarningName() { return this.dialogData.name != null ? this.dialogData.name : this.i18nService.t("thisUser"); } @@ -103,14 +108,6 @@ export class AccountRecoveryDialogComponent implements OnInit { private toastService: ToastService, ) {} - async ngOnInit() { - const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); - - this.masterPasswordPolicyOptions = await firstValueFrom( - this.policyService.masterPasswordPolicyOptions$(userId), - ); - } - handlePrimaryButtonClick = async () => { try { this.submitting = true;