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 };
|
params.current = { ...data, genres, joined_within_days, active_within_days };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dispatch(loadPrefetched());
|
|
||||||
|
|
||||||
currentPage.current = nextPage.current
|
currentPage.current = nextPage.current
|
||||||
|
|
||||||
if(currentPage.current === 0 && nextPage.current === 0){
|
if(currentPage.current === 0 && nextPage.current === 0){
|
||||||
dispatch(fetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
|
dispatch(fetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
|
||||||
}else{
|
}else{
|
||||||
|
if(prefetched.length > 0){
|
||||||
|
dispatch(loadPrefetched());
|
||||||
|
}
|
||||||
if(hasOffset){
|
if(hasOffset){
|
||||||
dispatch(preFetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
|
dispatch(preFetchPeople({ data: params.current, page: nextPage.current, limit: perPageLimit }));
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +225,7 @@ function JKPeopleFilter() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [loadingStatus, hasOffset])
|
}, [loadingStatus])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setShowLoadMore(prefetched.length > 0 || hasOffset)
|
setShowLoadMore(prefetched.length > 0 || hasOffset)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue