fixes for pagination people filter component

This commit is contained in:
Nuwan 2022-10-25 23:27:58 +05:30
parent 0cac99e407
commit a9c0315697
1 changed files with 4 additions and 3 deletions

View File

@ -171,13 +171,14 @@ function JKPeopleFilter() {
params.current = { ...data, genres, joined_within_days, active_within_days };
try {
dispatch(loadPrefetched());
currentPage.current = nextPage.current
if(currentPage.current === 0 && nextPage.current === 0){
dispatch(fetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
}else{
if(prefetched.length > 0){
dispatch(loadPrefetched());
}
if(hasOffset){
dispatch(preFetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
}
@ -224,7 +225,7 @@ function JKPeopleFilter() {
}
}
}, [loadingStatus, hasOffset])
}, [loadingStatus])
useEffect(() => {
setShowLoadMore(prefetched.length > 0 || hasOffset)