Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions frontend/src/hooks/useInfiniteScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export const useInfiniteScroll = <DataItem, Args extends InfinityListArgs>({
const lastRequestParams = useRef<TRunsRequestParams | undefined>(undefined);
const [disabledMore, setDisabledMore] = useState(false);
const { limit, ...argsProp } = args;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const oldArgsProps = useRef<Partial<Args>>(argsProp);
const lastArgsProps = useRef<Partial<Args>>(null);

const [getItems, { isLoading, isFetching }] = useLazyQuery({ ...args } as Args);

Expand All @@ -57,13 +55,11 @@ export const useInfiniteScroll = <DataItem, Args extends InfinityListArgs>({
};

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) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Runs/List/hooks/useFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const useFilters = ({ localStorePrefix }: Args) => {
...params,
only_active: onlyActive,
};
}, [propertyFilterQuery]);
}, [propertyFilterQuery, onlyActive]);

return {
filteringRequestParams,
Expand Down
Loading