load nested collections

This commit is contained in:
Kyle Spearrin 2018-10-25 12:18:36 -04:00
parent 59f0549072
commit b0eea9d7ce
1 changed files with 7 additions and 2 deletions

View File

@ -16,8 +16,9 @@ import { FolderService } from '../../abstractions/folder.service';
export class GroupingsComponent {
@Input() showFolders = true;
@Input() loadNestedFolder = false;
@Input() loadNestedFolders = false;
@Input() showCollections = true;
@Input() loadNestedCollections = false;
@Input() showFavorites = true;
@Output() onAllClicked = new EventEmitter();
@ -31,6 +32,7 @@ export class GroupingsComponent {
folders: FolderView[];
nestedFolders: Array<TreeNode<FolderView>>;
collections: CollectionView[];
nestedCollections: Array<TreeNode<CollectionView>>;
loaded: boolean = false;
cipherType = CipherType;
selectedAll: boolean = false;
@ -61,6 +63,9 @@ export class GroupingsComponent {
} else {
this.collections = collections;
}
if (this.loadNestedCollections) {
this.nestedCollections = await this.collectionService.getAllNested(this.collections);
}
}
async loadFolders() {
@ -68,7 +73,7 @@ export class GroupingsComponent {
return;
}
this.folders = await this.folderService.getAllDecrypted();
if (this.loadNestedFolder) {
if (this.loadNestedFolders) {
this.nestedFolders = await this.folderService.getAllNested();
}
}