Skip to content

Commit d516121

Browse files
authored
Fixed defect #2752 (#2784)
* Fixed defect #2752 * Small fixes #2752 * Small fixes #2752
1 parent b859f53 commit d516121

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

frontend/src/hooks/useInfiniteScroll.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ export const useInfiniteScroll = <DataItem, Args extends InfinityListArgs>({
2929
const lastRequestParams = useRef<TRunsRequestParams | undefined>(undefined);
3030
const [disabledMore, setDisabledMore] = useState(false);
3131
const { limit, ...argsProp } = args;
32-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
33-
// @ts-ignore
34-
const oldArgsProps = useRef<Partial<Args>>(argsProp);
32+
const lastArgsProps = useRef<Partial<Args>>(null);
3533

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

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

5957
useEffect(() => {
60-
if (!isEqual(argsProp, oldArgsProps.current)) {
58+
if (!isEqual(argsProp, lastArgsProps.current)) {
6159
getEmptyList();
62-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
63-
// @ts-ignore
64-
oldArgsProps.current = argsProp;
60+
lastArgsProps.current = argsProp as Args;
6561
}
66-
}, [argsProp, oldArgsProps]);
62+
}, [argsProp, lastArgsProps]);
6763

6864
const getMore = async () => {
6965
if (isLoadingRef.current || disabledMore) {

frontend/src/pages/Runs/List/hooks/useFilters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const useFilters = ({ localStorePrefix }: Args) => {
136136
...params,
137137
only_active: onlyActive,
138138
};
139-
}, [propertyFilterQuery]);
139+
}, [propertyFilterQuery, onlyActive]);
140140

141141
return {
142142
filteringRequestParams,

0 commit comments

Comments
 (0)