1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

view grouping of ciphers for a collection

This commit is contained in:
Kyle Spearrin
2017-11-22 21:55:48 -05:00
parent 991ddd8271
commit 2e9b3d0943
12 changed files with 79 additions and 49 deletions

View File

@@ -178,12 +178,14 @@ export default class CipherService {
return this.decryptedCipherCache;
}
async getAllDecryptedForFolder(folderId: string): Promise<any[]> {
async getAllDecryptedForGrouping(groupingId: string, folder: boolean = true): Promise<any[]> {
const ciphers = await this.getAllDecrypted();
const ciphersToReturn: any[] = [];
ciphers.forEach((cipher) => {
if (cipher.folderId === folderId) {
if (folder && cipher.folderId === groupingId) {
ciphersToReturn.push(cipher);
} else if (!folder && cipher.collectionIds != null && cipher.collectionIds.indexOf(groupingId) > -1) {
ciphersToReturn.push(cipher);
}
});