about summary refs log tree commit diff
path: root/src/view/com/posts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2025-03-17 12:18:59 -0500
committerGitHub <noreply@github.com>2025-03-17 12:18:59 -0500
commit4b7bda705e8428f99af14242ea68369e5bbe59b9 (patch)
treef8900beba2c98c7659da53889e2c57823b27cbcf /src/view/com/posts
parent799205e6c258e0fdc88b52fb7c85e4f8798f9c72 (diff)
downloadvoidsky-4b7bda705e8428f99af14242ea68369e5bbe59b9.tar.zst
Don't poll for latest for Discover (#7993)
Diffstat (limited to 'src/view/com/posts')
-rw-r--r--src/view/com/posts/PostFeed.tsx17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/view/com/posts/PostFeed.tsx b/src/view/com/posts/PostFeed.tsx
index 79578ad6b..a99077c0c 100644
--- a/src/view/com/posts/PostFeed.tsx
+++ b/src/view/com/posts/PostFeed.tsx
@@ -226,6 +226,11 @@ let PostFeed = ({
   )
 
   const checkForNew = React.useCallback(async () => {
+    // Discover always has fresh content
+    if (feedUriOrActorDid === DISCOVER_FEED_URI) {
+      return onHasNew?.(true)
+    }
+
     if (!data?.pages[0] || isFetching || !onHasNew || !enabled || disablePoll) {
       return
     }
@@ -240,7 +245,17 @@ let PostFeed = ({
     } catch (e) {
       logger.error('Poll latest failed', {feed, message: String(e)})
     }
-  }, [feed, data, isFetching, isEmpty, onHasNew, enabled, disablePoll, refetch])
+  }, [
+    feed,
+    data,
+    isFetching,
+    isEmpty,
+    onHasNew,
+    enabled,
+    disablePoll,
+    refetch,
+    feedUriOrActorDid,
+  ])
 
   const myDid = currentAccount?.did || ''
   const onPostCreated = React.useCallback(() => {