1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 19:23:52 +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);
}
});

View File

@@ -1,4 +1,5 @@
import CipherService from './cipher.service';
import CollectionService from './collection.service';
import ConstantsService from './constants.service';
import CryptoService from './crypto.service';
import FolderService from './folder.service';
@@ -6,8 +7,8 @@ import UtilsService from './utils.service';
export default class LockService {
constructor(private cipherService: CipherService, private folderService: FolderService,
private cryptoService: CryptoService, private utilsService: UtilsService,
private setIcon: Function, private refreshBadgeAndMenu: Function) {
private collectionService: CollectionService, private cryptoService: CryptoService,
private utilsService: UtilsService, private setIcon: Function, private refreshBadgeAndMenu: Function) {
this.checkLock();
setInterval(() => this.checkLock(), 10 * 1000); // check every 10 seconds
@@ -70,6 +71,7 @@ export default class LockService {
this.setIcon();
this.folderService.clearCache();
this.cipherService.clearCache();
this.collectionService.clearCache();
this.refreshBadgeAndMenu();
}