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

set org id and collections if filtered

This commit is contained in:
Kyle Spearrin
2018-10-22 16:46:48 -04:00
parent 69f0339bd5
commit a24c41ff25
5 changed files with 21 additions and 20 deletions

View File

@@ -187,7 +187,7 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async filterCollection(collectionId: string) {
this.ciphersComponent.showAddNew = false;
this.ciphersComponent.showAddNew = true;
this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection');
await this.ciphersComponent.load((c) => c.collectionIds != null && c.collectionIds.indexOf(collectionId) > -1);
this.clearFilters();
@@ -327,6 +327,13 @@ export class VaultComponent implements OnInit, OnDestroy {
const component = this.editCipher(null);
component.type = this.type;
component.folderId = this.folderId === 'none' ? null : this.folderId;
if (this.collectionId != null) {
const collection = this.groupingsComponent.collections.filter((c) => c.id === this.collectionId);
if (collection.length > 0) {
component.organizationId = collection[0].organizationId;
component.collectionIds = [this.collectionId];
}
}
}
editCipher(cipher: CipherView) {