diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts index e9abe7bff2..f6457b8db5 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts @@ -311,6 +311,19 @@ describe("VaultPopupItemsService", () => { done(); }); }); + + it("should return true when all ciphers are deleted", (done) => { + cipherServiceMock.getAllDecrypted.mockResolvedValue([ + { id: "1", type: CipherType.Login, name: "Login 1", isDeleted: true }, + { id: "2", type: CipherType.Login, name: "Login 2", isDeleted: true }, + { id: "3", type: CipherType.Login, name: "Login 3", isDeleted: true }, + ] as CipherView[]); + + service.emptyVault$.subscribe((empty) => { + expect(empty).toBe(true); + done(); + }); + }); }); describe("noFilteredResults$", () => { 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 1c26f9cc71..eb1af2cf71 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 @@ -87,14 +87,16 @@ export class VaultPopupItemsService { map(([organizations, collections]) => { const orgMap = Object.fromEntries(organizations.map((org) => [org.id, org])); const collectionMap = Object.fromEntries(collections.map((col) => [col.id, col])); - return ciphers.map( - (cipher) => - new PopupCipherView( - cipher, - cipher.collectionIds?.map((colId) => collectionMap[colId as CollectionId]), - orgMap[cipher.organizationId as OrganizationId], - ), - ); + return ciphers + .filter((c) => !c.isDeleted) + .map( + (cipher) => + new PopupCipherView( + cipher, + cipher.collectionIds?.map((colId) => collectionMap[colId as CollectionId]), + orgMap[cipher.organizationId as OrganizationId], + ), + ); }), ), ),