1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

[PS-1078] Refactor FolderService to use Observables (#3022)

This commit is contained in:
Oscar Hinton
2022-07-12 20:25:18 +02:00
committed by GitHub
parent a43aa9612c
commit 23253b3882
32 changed files with 421 additions and 180 deletions

View File

@@ -1,4 +1,5 @@
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
import { Observable } from "rxjs";
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
@@ -51,7 +52,7 @@ export class AddEditComponent implements OnInit {
editMode = false;
cipher: CipherView;
folders: FolderView[];
folders$: Observable<FolderView[]>;
collections: CollectionView[] = [];
title: string;
formPromise: Promise<any>;
@@ -243,7 +244,7 @@ export class AddEditComponent implements OnInit {
}
}
this.folders = await this.folderService.getAllDecrypted();
this.folders$ = this.folderService.folderViews$;
if (this.editMode && this.previousCipherId !== this.cipherId) {
this.eventService.collect(EventType.Cipher_ClientViewed, this.cipherId);