mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-16792] [PM-16822] Encapsulate encryptor and state provision within UserStateSubject (#13195)
This commit is contained in:
@@ -43,6 +43,7 @@ import { FileDownloadService } from "@bitwarden/common/platform/abstractions/fil
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { pin } from "@bitwarden/common/tools/rx";
|
||||
import {
|
||||
AsyncActionsModule,
|
||||
BitSubmitDirective,
|
||||
@@ -220,8 +221,18 @@ export class ExportComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
|
||||
|
||||
// Wire up the password generation for the password-protected export
|
||||
const account$ = this.accountService.activeAccount$.pipe(
|
||||
pin({
|
||||
name() {
|
||||
return "active export account";
|
||||
},
|
||||
distinct(previous, current) {
|
||||
return previous.id === current.id;
|
||||
},
|
||||
}),
|
||||
);
|
||||
this.generatorService
|
||||
.generate$(Generators.password, { on$: this.onGenerate$ })
|
||||
.generate$(Generators.password, { on$: this.onGenerate$, account$ })
|
||||
.pipe(takeUntil(this.destroy$))
|
||||
.subscribe((generated) => {
|
||||
this.exportForm.patchValue({
|
||||
|
||||
Reference in New Issue
Block a user