From 30587d625a15f321599acf377a7f734eaa085c48 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 17 Oct 2018 16:09:09 -0400 Subject: [PATCH] fixes to showAdd and filtering on load for non-admins --- src/app/organizations/vault/ciphers.component.ts | 2 +- src/app/organizations/vault/vault.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/organizations/vault/ciphers.component.ts index 39106167e32..85db24f6abc 100644 --- a/src/app/organizations/vault/ciphers.component.ts +++ b/src/app/organizations/vault/ciphers.component.ts @@ -41,7 +41,7 @@ export class CiphersComponent extends BaseCiphersComponent { async load(filter: (cipher: CipherView) => boolean = null) { if (!this.organization.isAdmin) { - await super.load(); + await super.load(filter); return; } this.accessEvents = this.organization.useEvents; diff --git a/src/app/organizations/vault/vault.component.ts b/src/app/organizations/vault/vault.component.ts index 7d28f1c04d6..83ff746e2d2 100644 --- a/src/app/organizations/vault/vault.component.ts +++ b/src/app/organizations/vault/vault.component.ts @@ -124,7 +124,7 @@ export class VaultComponent implements OnInit, OnDestroy { } async clearGroupingFilters() { - this.ciphersComponent.showAddNew = true; + this.ciphersComponent.showAddNew = this.showAdd; this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchVault'); await this.ciphersComponent.applyFilter(); this.clearFilters(); @@ -132,7 +132,7 @@ export class VaultComponent implements OnInit, OnDestroy { } async filterCipherType(type: CipherType, load = false) { - this.ciphersComponent.showAddNew = true; + this.ciphersComponent.showAddNew = this.showAdd; this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchType'); const filter = (c: CipherView) => c.type === type; if (load) {