Feed bugfixes (#2204)

* Dont show both an error and empty message in the feed

* Add a sanity check when attempting to fill the first 30
This commit is contained in:
Paul Frazee 2023-12-13 12:17:14 -08:00 committed by GitHub
parent e3ba014be0
commit 8245e56747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View file

@ -291,7 +291,13 @@ export function usePostFeedQuery(
}
}
if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) {
if (
!isFetching &&
hasNextPage &&
count < PAGE_SIZE &&
numEmpties < 3 &&
(data?.pages.length || 0) < 6
) {
query.fetchNextPage()
}
}, [query])