From f3ae574f460edef2fce66f1624fd47ea67b17d9e Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:20:59 -0700 Subject: [PATCH] simplify getting activeAccount userId and email --- .../change-password/change-password.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/auth/src/angular/change-password/change-password.component.ts b/libs/auth/src/angular/change-password/change-password.component.ts index 92a38c96645..0ee18ac3835 100644 --- a/libs/auth/src/angular/change-password/change-password.component.ts +++ b/libs/auth/src/angular/change-password/change-password.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from "@angular/core"; -import { firstValueFrom, map } from "rxjs"; +import { firstValueFrom } from "rxjs"; import { ChangePasswordService } from "@bitwarden/auth/common"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; @@ -57,11 +57,9 @@ export class ChangePasswordComponent implements OnInit { async ngOnInit() { this.userkeyRotationV2 = await this.configService.getFeatureFlag(FeatureFlag.UserKeyRotationV2); - this.email = await firstValueFrom( - this.accountService.activeAccount$.pipe(map((a) => a?.email)), - ); - - const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$)); + const activeAccount = await firstValueFrom(this.accountService.activeAccount$); + const userId = activeAccount.id; + this.email = activeAccount.email; this.masterPasswordPolicyOptions = await firstValueFrom( this.policyService.masterPasswordPolicyOptions$(userId),