diff options
Diffstat (limited to 'src/state/queries/post-feed.ts')
-rw-r--r-- | src/state/queries/post-feed.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts index dede8a956..9bd1dacb3 100644 --- a/src/state/queries/post-feed.ts +++ b/src/state/queries/post-feed.ts @@ -217,13 +217,17 @@ export function usePostFeedQuery( const {isFetching, hasNextPage, data} = query let count = 0 + let numEmpties = 0 for (const page of data?.pages || []) { + if (page.slices.length === 0) { + numEmpties++ + } for (const slice of page.slices) { count += slice.items.length } } - if (!isFetching && hasNextPage && count < PAGE_SIZE) { + if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) { query.fetchNextPage() } }, [query]) |