diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts index 92276ef633f..f8bbb930f72 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/vault-v2.component.ts @@ -170,7 +170,7 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy { this.cipherService .failedToDecryptCiphers$(activeUserId) .pipe( - map((ciphers) => ciphers.filter((c) => !c.isDeleted)), + map((ciphers) => (ciphers ? ciphers.filter((c) => !c.isDeleted) : [])), filter((ciphers) => ciphers.length > 0), take(1), takeUntilDestroyed(this.destroyRef), diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts index dac6a141d41..5f2ec858ed6 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts @@ -108,7 +108,7 @@ export class VaultPopupItemsService { this.cipherService.failedToDecryptCiphers$(userId), ]), ), - map(([ciphers, failedToDecryptCiphers]) => [...failedToDecryptCiphers, ...ciphers]), + map(([ciphers, failedToDecryptCiphers]) => [...(failedToDecryptCiphers || []), ...ciphers]), ), ), shareReplay({ refCount: true, bufferSize: 1 }), diff --git a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts index 187c8772e88..6cce5796cbe 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts @@ -12,7 +12,6 @@ import { startWith, switchMap, take, - tap, } from "rxjs"; import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; @@ -360,10 +359,10 @@ export class VaultPopupListFiltersService { switchMap((userId) => { // Observable of cipher views const cipherViews$ = this.cipherService.cipherViews$(userId).pipe( - tap((cipherViews) => { - this.cipherViews = Object.values(cipherViews); + map((ciphers) => { + this.cipherViews = ciphers ? Object.values(ciphers) : []; + return this.cipherViews; }), - map((ciphers) => Object.values(ciphers)), ); return combineLatest([ diff --git a/libs/common/src/vault/abstractions/cipher.service.ts b/libs/common/src/vault/abstractions/cipher.service.ts index 1e4275ff89b..2d381faaa8d 100644 --- a/libs/common/src/vault/abstractions/cipher.service.ts +++ b/libs/common/src/vault/abstractions/cipher.service.ts @@ -31,7 +31,7 @@ export abstract class CipherService implements UserKeyRotationDataProvider; + abstract failedToDecryptCiphers$(userId: UserId): Observable; abstract clearCache(userId: UserId): Promise; abstract encrypt( model: CipherView,