Skip to content

Commit

Permalink
Don't refresh org vault on filter change (#3879)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat committed Oct 27, 2022
1 parent da47992 commit 96205bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions apps/web/src/app/organizations/vault/vault.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,16 @@ export class VaultComponent implements OnInit, OnDestroy {
async applyVaultFilter(vaultFilter: VaultFilter) {
this.ciphersComponent.showAddNew = vaultFilter.status !== "trash";
this.activeFilter = vaultFilter;
await this.ciphersComponent.reload(
this.activeFilter.buildFilter(),
vaultFilter.status === "trash"
);

// Hack to avoid calling cipherService.getAllFromApiForOrganization every time the vault filter changes.
// Call CiphersComponent.applyFilter directly instead of going through CiphersComponent.reload, which
// reloads all the ciphers unnecessarily. Will be fixed properly by EC-14.
this.ciphersComponent.loaded = false;
this.ciphersComponent.deleted = vaultFilter.status === "trash" || false;
await this.ciphersComponent.applyFilter(this.activeFilter.buildFilter());
this.ciphersComponent.loaded = true;
// End hack

this.vaultFilterComponent.searchPlaceholder =
this.vaultService.calculateSearchBarLocalizationString(this.activeFilter);
this.go();
Expand Down

0 comments on commit 96205bf

Please sign in to comment.