filter out deleted ciphers in popup service (#10035)
This commit is contained in:
parent
91294e9c4d
commit
c7d64cfc25
|
@ -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$", () => {
|
||||
|
|
|
@ -87,7 +87,9 @@ 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(
|
||||
return ciphers
|
||||
.filter((c) => !c.isDeleted)
|
||||
.map(
|
||||
(cipher) =>
|
||||
new PopupCipherView(
|
||||
cipher,
|
||||
|
|
Loading…
Reference in New Issue