mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 19:53:43 +00:00
Use account service for getting account profile data. (#9133)
* Use account service for getting account profile data. * desktop build fixes * CLI build fixes * Remove state service methods
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
|
||||
import { GeneratorComponent as BaseGeneratorComponent } from "@bitwarden/angular/tools/generator/components/generator.component";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
@@ -26,6 +27,7 @@ export class GeneratorComponent extends BaseGeneratorComponent {
|
||||
logService: LogService,
|
||||
route: ActivatedRoute,
|
||||
private dialogService: DialogService,
|
||||
accountService: AccountService,
|
||||
) {
|
||||
super(
|
||||
passwordGenerationService,
|
||||
@@ -35,6 +37,7 @@ export class GeneratorComponent extends BaseGeneratorComponent {
|
||||
i18nService,
|
||||
logService,
|
||||
route,
|
||||
accountService,
|
||||
window,
|
||||
);
|
||||
if (platformUtilsService.isSelfHost()) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { firstValueFrom, map } from "rxjs";
|
||||
|
||||
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { BreachAccountResponse } from "@bitwarden/common/models/response/breach-account.response";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-breach-report",
|
||||
@@ -17,11 +18,13 @@ export class BreachReportComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private auditService: AuditService,
|
||||
private stateService: StateService,
|
||||
private accountService: AccountService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
this.username = await this.stateService.getEmail();
|
||||
this.username = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(map((a) => a?.email)),
|
||||
);
|
||||
}
|
||||
|
||||
async submit() {
|
||||
|
||||
Reference in New Issue
Block a user