Only poll feed when feed page is focused (#2064)

* Do no poll when screen is not focused

* Avoid polling unless focused

* Handle homepage in background

* Fix the intl:check to ignore comments in diffs

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Eric Bailey
2023-12-01 15:40:50 -06:00
committed by GitHub
parent f80bd30ef4
commit 9dec9d7276
7 changed files with 26 additions and 13 deletions
+1 -1
View File
@@ -420,6 +420,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
<View>
<Feed
testID="postsFeed"
enabled={isFocused}
feed={feed}
pollInterval={30e3}
scrollElRef={scrollElRef}
@@ -428,7 +429,6 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
scrollEventThrottle={1}
renderEmptyState={renderPostsEmpty}
headerOffset={headerHeight}
enabled={isFocused}
/>
{(isScrolledDown || hasNew) && (
<LoadLatestBtn