From c687172de96bd6aa85d3aa025c2e0f024640f345 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 14 Nov 2023 10:33:05 -0800 Subject: [PATCH] Fix poll latest loop (#1901) * Avoid pollLatest loop * Set poll interval on profile feeds --- src/view/com/posts/Feed.tsx | 3 +++ src/view/screens/Profile.tsx | 1 + 2 files changed, 4 insertions(+) diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index 6cbad7f716..5c9d1ad2c1 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 1a2982027e..724c47c95d 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -350,6 +350,7 @@ const FeedSection = React.forwardRef(