1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

[PM-5757] Update local collection data when a collection is updated (#7940)

* [PM-5757] Update local data when a collection is updated

* [PM-5757] Use defer() for collections re-evaluate the promise on refresh$
This commit is contained in:
Shane Melton
2024-02-13 13:04:13 -08:00
committed by GitHub
parent f0ae318f57
commit 2a9d396a01
3 changed files with 16 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import { ActivatedRoute, Params, Router } from "@angular/router";
import {
BehaviorSubject,
combineLatest,
defer,
firstValueFrom,
lastValueFrom,
Observable,
@@ -250,7 +251,7 @@ export class VaultComponent implements OnInit, OnDestroy {
const allCollectionsWithoutUnassigned$ = combineLatest([
organizationId$.pipe(switchMap((orgId) => this.collectionAdminService.getAll(orgId))),
this.collectionService.getAllDecrypted(),
defer(() => this.collectionService.getAllDecrypted()),
]).pipe(
map(([adminCollections, syncCollections]) => {
const syncCollectionDict = Object.fromEntries(syncCollections.map((c) => [c.id, c]));