1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

simplify getting activeAccount userId and

email
This commit is contained in:
rr-bw
2025-04-08 15:20:59 -07:00
parent 2a976a0db2
commit f3ae574f46

View File

@@ -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),