From 4b7bda705e8428f99af14242ea68369e5bbe59b9 Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Mon, 17 Mar 2025 12:18:59 -0500
Subject: Don't poll for latest for Discover (#7993)

---
 src/view/com/posts/PostFeed.tsx | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'src/view/com/posts/PostFeed.tsx')

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(() => {
-- 
cgit 1.4.1

