From 518410d53f3c4c42c25b6eb63cc82a690d7199ee Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 5 Jun 2020 19:13:15 -0400 Subject: [PATCH] Remove unneeded params from hook. --- .../plugins/uptime/public/hooks/use_filter_update.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/uptime/public/hooks/use_filter_update.ts b/x-pack/plugins/uptime/public/hooks/use_filter_update.ts index 54b94b8c98843..550de134c49bc 100644 --- a/x-pack/plugins/uptime/public/hooks/use_filter_update.ts +++ b/x-pack/plugins/uptime/public/hooks/use_filter_update.ts @@ -20,19 +20,14 @@ interface SelectedFilters { selectedFilters: Map; } -export const useFilterUpdate = ( - fieldName?: string, - values?: string[], - shouldUpdateUrl?: boolean, - alertParamFilters?: any -): SelectedFilters => { +export const useFilterUpdate = (fieldName?: string, values?: string[]): SelectedFilters => { const [getUrlParams, updateUrl] = useUrlParams(); const { filters: currentFilters } = getUrlParams(); // update filters in the URL from filter group const onFilterUpdate = (filtersKuery: string) => { - if (currentFilters !== filtersKuery && shouldUpdateUrl) { + if (currentFilters !== filtersKuery) { updateUrl({ filters: filtersKuery, pagination: '' }); } }; @@ -62,7 +57,7 @@ export const useFilterUpdate = ( } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [alertParamFilters, fieldName, values]); + }, [fieldName, values]); return { selectedTags: filterKueries.get('tags') || [],