about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-14 10:33:05 -0800
committerGitHub <noreply@github.com>2023-11-14 12:33:05 -0600
commitc687172de96bd6aa85d3aa025c2e0f024640f345 (patch)
treeb6a3256767b01727e41b196c1265f0e37e6b72b4 /src
parent3fde1bea1bffecb6740f261b88ceb34134e0d418 (diff)
downloadvoidsky-c687172de96bd6aa85d3aa025c2e0f024640f345.tar.zst
Fix poll latest loop (#1901)
* Avoid pollLatest loop

* Set poll interval on profile feeds
Diffstat (limited to 'src')
-rw-r--r--src/view/com/posts/Feed.tsx3
-rw-r--r--src/view/screens/Profile.tsx1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx
index 6cbad7f71..5c9d1ad2c 100644
--- a/src/view/com/posts/Feed.tsx
+++ b/src/view/com/posts/Feed.tsx
@@ -106,6 +106,9 @@ export function Feed({
     checkForNewRef.current = checkForNew
   }, [checkForNew])
   React.useEffect(() => {
+    if (!pollInterval) {
+      return
+    }
     const i = setInterval(() => checkForNewRef.current?.(), pollInterval)
     return () => clearInterval(i)
   }, [pollInterval])
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx
index 1a2982027..724c47c95 100644
--- a/src/view/screens/Profile.tsx
+++ b/src/view/screens/Profile.tsx
@@ -350,6 +350,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
         <Feed
           testID="postsFeed"
           feed={feed}
+          pollInterval={30e3}
           scrollElRef={scrollElRef}
           onHasNew={setHasNew}
           onScroll={onScroll}