about summary refs log tree commit diff
path: root/src/state/queries/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/notifications')
-rw-r--r--src/state/queries/notifications/feed.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/state/queries/notifications/feed.ts b/src/state/queries/notifications/feed.ts
index 3f9700c79..b8d8d6160 100644
--- a/src/state/queries/notifications/feed.ts
+++ b/src/state/queries/notifications/feed.ts
@@ -91,11 +91,15 @@ export function useNotificationFeedQuery(opts?: {enabled?: boolean}) {
     const {isFetching, hasNextPage, data} = query
 
     let count = 0
+    let numEmpties = 0
     for (const page of data?.pages || []) {
+      if (!page.items.length) {
+        numEmpties++
+      }
       count += page.items.length
     }
 
-    if (!isFetching && hasNextPage && count < PAGE_SIZE) {
+    if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) {
       query.fetchNextPage()
     }
   }, [query])