about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/state/queries/notifications/feed.ts8
-rw-r--r--src/state/queries/post-feed.ts8
-rw-r--r--src/view/com/posts/Feed.tsx3
3 files changed, 15 insertions, 4 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])
diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts
index 7847c7202..efdb42dd2 100644
--- a/src/state/queries/post-feed.ts
+++ b/src/state/queries/post-feed.ts
@@ -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])
diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx
index c4f859e04..24a7f5b42 100644
--- a/src/view/com/posts/Feed.tsx
+++ b/src/view/com/posts/Feed.tsx
@@ -167,8 +167,7 @@ let Feed = ({
     if (isFetched) {
       if (isError && isEmpty) {
         arr = arr.concat([ERROR_ITEM])
-      }
-      if (isEmpty) {
+      } else if (isEmpty) {
         arr = arr.concat([EMPTY_FEED_ITEM])
       } else if (data) {
         for (const page of data?.pages) {