Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EC-626] Don't refresh org vault on filter change #3879

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
eliykat marked this conversation as resolved.
Show resolved Hide resolved
this.ciphersComponent.loaded = true;
// End hack

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