diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index fce33a972b..0a8e876971 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute, Params, Router } from "@angular/router"; import { BehaviorSubject, combineLatest, - defer, firstValueFrom, lastValueFrom, Observable, @@ -283,27 +282,10 @@ export class VaultComponent implements OnInit, OnDestroy { this.currentSearchText$ = this.route.queryParams.pipe(map((queryParams) => queryParams.search)); - this.allCollectionsWithoutUnassigned$ = combineLatest([ - organizationId$.pipe(switchMap((orgId) => this.collectionAdminService.getAll(orgId))), - defer(() => this.collectionService.getAllDecrypted()), - ]).pipe( - map(([adminCollections, syncCollections]) => { - const syncCollectionDict = Object.fromEntries(syncCollections.map((c) => [c.id, c])); - - return adminCollections.map((collection) => { - const currentId: any = collection.id; - - const match = syncCollectionDict[currentId]; - - if (match) { - collection.manage = match.manage; - collection.readOnly = match.readOnly; - collection.hidePasswords = match.hidePasswords; - } - return collection; - }); - }), - shareReplay({ refCount: true, bufferSize: 1 }), + this.allCollectionsWithoutUnassigned$ = this.refresh$.pipe( + switchMap(() => organizationId$), + switchMap((orgId) => this.collectionAdminService.getAll(orgId)), + shareReplay({ refCount: false, bufferSize: 1 }), ); this.editableCollections$ = this.allCollectionsWithoutUnassigned$.pipe( @@ -367,7 +349,6 @@ export class VaultComponent implements OnInit, OnDestroy { map((ciphers) => { return Object.fromEntries(ciphers.map((c) => [c.id, c])); }), - shareReplay({ refCount: true, bufferSize: 1 }), ); const nestedCollections$ = allCollections$.pipe(