Skip to content

Commit

Permalink
make remove filter work (#58871) (#59217)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Mar 4, 2020
1 parent ed63c1c commit a181529
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,17 @@ export class VegaBaseView {
*/
async removeFilterHandler(query, index) {
const indexId = await this._findIndex(index);
const filter = esFilters.buildQueryFilter(query, indexId);
const filterToRemove = esFilters.buildQueryFilter(query, indexId);

const currentFilters = this._filterManager.getFilters();
const existingFilter = currentFilters.find(filter =>
esFilters.compareFilters(filter, filterToRemove)
);

if (!existingFilter) return;

try {
this._filterManager.removeFilter(filter);
this._filterManager.removeFilter(existingFilter);
} catch (err) {
this.onError(err);
}
Expand Down

0 comments on commit a181529

Please sign in to comment.