diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-12-13 12:17:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 12:17:14 -0800 |
commit | 8245e567473601b76ef20545d748810074439458 (patch) | |
tree | 7f80531280c782eb916cd5239ae7d2ee7483e903 /src/state/queries/notifications/feed.ts | |
parent | e3ba014be00f545b3dbd39b5dcfc198a69c790d4 (diff) | |
download | voidsky-8245e567473601b76ef20545d748810074439458.tar.zst |
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
Diffstat (limited to 'src/state/queries/notifications/feed.ts')
-rw-r--r-- | src/state/queries/notifications/feed.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/state/queries/notifications/feed.ts b/src/state/queries/notifications/feed.ts index 82eda06ea..dc206df79 100644 --- a/src/state/queries/notifications/feed.ts +++ b/src/state/queries/notifications/feed.ts @@ -114,7 +114,13 @@ export function useNotificationFeedQuery(opts?: {enabled?: boolean}) { count += page.items.length } - if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) { + if ( + !isFetching && + hasNextPage && + count < PAGE_SIZE && + numEmpties < 3 && + (data?.pages.length || 0) < 6 + ) { query.fetchNextPage() } }, [query]) |