From 044334a2fafa8de2f0d5c887a62b08f4cd8fde89 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Wed, 7 May 2025 15:53:40 -0700 Subject: [PATCH] [PM-18721] simplify retreival of activeUserId --- .../takeover/emergency-access-takeover-dialog.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover-dialog.component.ts b/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover-dialog.component.ts index a7f8868f17a..c11b9cd4372 100644 --- a/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover-dialog.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/takeover/emergency-access-takeover-dialog.component.ts @@ -10,6 +10,7 @@ import { import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; +import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { @@ -78,15 +79,13 @@ export class EmergencyAccessTakeoverDialogComponent implements OnInit { ) {} async ngOnInit() { - const activeAccount = await firstValueFrom(this.accountService.activeAccount$); - const userId = activeAccount?.id; - + const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); const grantorPolicies = await this.emergencyAccessService.getGrantorPolicies( this.dialogData.emergencyAccessId, ); this.masterPasswordPolicyOptions = await firstValueFrom( - this.policyService.masterPasswordPolicyOptions$(userId, grantorPolicies), + this.policyService.masterPasswordPolicyOptions$(activeUserId, grantorPolicies), ); }