Skip to content

Commit

Permalink
closes elastic#44349, as well as SDH issue elastic#64
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Nov 6, 2019
1 parent c485893 commit d5eb45f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/plugins/data/public/query/filter_manager/filter_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ export class FilterManager {
private handleStateUpdate(newFilters: Filter[]) {
// global filters should always be first
newFilters.sort(({ $state: a }: Filter, { $state: b }: Filter): number => {
return a!.store === FilterStateStore.GLOBAL_STATE &&
b!.store !== FilterStateStore.GLOBAL_STATE
? -1
: 1;
if (a!.store === b!.store) {
return 0;
} else {
return a!.store === FilterStateStore.GLOBAL_STATE &&
b!.store !== FilterStateStore.GLOBAL_STATE
? -1
: 1;
}
});

const filtersUpdated = !_.isEqual(this.filters, newFilters);
Expand Down

0 comments on commit d5eb45f

Please sign in to comment.