diff --git a/ui/src/Stores/AlertStore.js b/ui/src/Stores/AlertStore.js index 9166d85db..21e03792d 100644 --- a/ui/src/Stores/AlertStore.js +++ b/ui/src/Stores/AlertStore.js @@ -242,26 +242,17 @@ class AlertStore { const storedIndex = this.filters.values.findIndex( f => f.raw === filter.text ); - if (storedIndex >= 0) { - this.filters.values[storedIndex] = Object.assign( - this.filters.values[storedIndex], - { - applied: true, - isValid: filter.isValid, - hits: filter.hits, - name: filter.name, - matcher: filter.matcher, - value: filter.value - } - ); - } else { - console.warn( - `Got response with filter ${ - filter.text - } which isn't one of applied filters, ignoring` - ); - return; - } + this.filters.values[storedIndex] = Object.assign( + this.filters.values[storedIndex], + { + applied: true, + isValid: filter.isValid, + hits: filter.hits, + name: filter.name, + matcher: filter.matcher, + value: filter.value + } + ); } let updates = {}; diff --git a/ui/src/Stores/AlertStore.test.js b/ui/src/Stores/AlertStore.test.js index fb55d512e..b8958bd1e 100644 --- a/ui/src/Stores/AlertStore.test.js +++ b/ui/src/Stores/AlertStore.test.js @@ -204,6 +204,7 @@ describe("AlertStore.fetch", () => { expect(store.status.value).toEqual(AlertStoreStatuses.Idle); expect(store.info.version).toBe("fakeVersion"); + expect(store.filters.values[0].applied).toBe(true); }); it("fetch() works with valid response", async () => {