diff --git a/frontend/src/hooks/useInfiniteScroll.ts b/frontend/src/hooks/useInfiniteScroll.ts index a6986a8226..f6db2fb8f3 100644 --- a/frontend/src/hooks/useInfiniteScroll.ts +++ b/frontend/src/hooks/useInfiniteScroll.ts @@ -29,9 +29,7 @@ export const useInfiniteScroll = ({ const lastRequestParams = useRef(undefined); const [disabledMore, setDisabledMore] = useState(false); const { limit, ...argsProp } = args; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const oldArgsProps = useRef>(argsProp); + const lastArgsProps = useRef>(null); const [getItems, { isLoading, isFetching }] = useLazyQuery({ ...args } as Args); @@ -57,13 +55,11 @@ export const useInfiniteScroll = ({ }; useEffect(() => { - if (!isEqual(argsProp, oldArgsProps.current)) { + if (!isEqual(argsProp, lastArgsProps.current)) { getEmptyList(); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - oldArgsProps.current = argsProp; + lastArgsProps.current = argsProp as Args; } - }, [argsProp, oldArgsProps]); + }, [argsProp, lastArgsProps]); const getMore = async () => { if (isLoadingRef.current || disabledMore) { diff --git a/frontend/src/pages/Runs/List/hooks/useFilters.ts b/frontend/src/pages/Runs/List/hooks/useFilters.ts index 70b87d0f30..951ceb35a5 100644 --- a/frontend/src/pages/Runs/List/hooks/useFilters.ts +++ b/frontend/src/pages/Runs/List/hooks/useFilters.ts @@ -136,7 +136,7 @@ export const useFilters = ({ localStorePrefix }: Args) => { ...params, only_active: onlyActive, }; - }, [propertyFilterQuery]); + }, [propertyFilterQuery, onlyActive]); return { filteringRequestParams,