fixes for pagination people filter component
This commit is contained in:
parent
0cac99e407
commit
a9c0315697
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue