mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
fix(recommendations): fixed recommendations page causing infinite network requests to tmdb api
TMDB API would only return 40 results and the recommendations page expected more. This would cause an infinite amount of network requests. A limit was implemented to specifically to solve this problem
This commit is contained in:
committed by
Fallenbagel
parent
b07f7032ad
commit
4f972be858
@@ -82,7 +82,9 @@ const useDiscover = <T extends BaseMedia, S = Record<string, never>>(
|
|||||||
|
|
||||||
const isEmpty = !isLoadingInitialData && titles?.length === 0;
|
const isEmpty = !isLoadingInitialData && titles?.length === 0;
|
||||||
const isReachingEnd =
|
const isReachingEnd =
|
||||||
isEmpty || (!!data && (data[data?.length - 1]?.results.length ?? 0) < 20);
|
isEmpty ||
|
||||||
|
(!!data && (data[data?.length - 1]?.results.length ?? 0) < 20) ||
|
||||||
|
(!!data && (data[data?.length - 1]?.totalResults ?? 0) < 41);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoadingInitialData,
|
isLoadingInitialData,
|
||||||
|
|||||||
Reference in New Issue
Block a user