Skip to content

Commit

Permalink
Remove unneeded params from hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Jun 5, 2020
1 parent b7053b8 commit 518410d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions x-pack/plugins/uptime/public/hooks/use_filter_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ interface SelectedFilters {
selectedFilters: Map<string, string[]>;
}

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: '' });
}
};
Expand Down Expand Up @@ -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') || [],
Expand Down

0 comments on commit 518410d

Please sign in to comment.