Skip to content

Commit d5eb45f

Browse files
author
Liza K
committed
closes #44349, as well as SDH issue #64
1 parent c485893 commit d5eb45f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/plugins/data/public/query/filter_manager/filter_manager.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ export class FilterManager {
7676
private handleStateUpdate(newFilters: Filter[]) {
7777
// global filters should always be first
7878
newFilters.sort(({ $state: a }: Filter, { $state: b }: Filter): number => {
79-
return a!.store === FilterStateStore.GLOBAL_STATE &&
80-
b!.store !== FilterStateStore.GLOBAL_STATE
81-
? -1
82-
: 1;
79+
if (a!.store === b!.store) {
80+
return 0;
81+
} else {
82+
return a!.store === FilterStateStore.GLOBAL_STATE &&
83+
b!.store !== FilterStateStore.GLOBAL_STATE
84+
? -1
85+
: 1;
86+
}
8387
});
8488

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

0 commit comments

Comments
 (0)