From 81c35d824ac8830a7542bbbed0502d0f863955d8 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Tue, 23 Apr 2024 14:53:39 +0200 Subject: [PATCH] filter query and filter on unmount --- .../change_point_detection/change_point_detection_context.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx index cd5c1380982be..75f4820316e30 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx @@ -247,6 +247,10 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => { if (globalFilters) { filterManager?.addFilters(globalFilters); } + return () => { + filterManager?.removeAll(); + queryString.clearQuery(); + }; }, [requestParamsFromUrl.filters, requestParamsFromUrl.query, filterManager, queryString] );