about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-06-06 12:10:50 -0700
committerGitHub <noreply@github.com>2024-06-06 12:10:50 -0700
commitfef16e060f3931ed3e731ce228cfb14510a934a2 (patch)
tree4539b5cf65d7fa323609342dcd5624cd9eefbfec
parentac25e43befef6a570c9af2d3c063a554d74ef6b6 (diff)
downloadvoidsky-fef16e060f3931ed3e731ce228cfb14510a934a2.tar.zst
Fix notifications pagination on web (#4400)
* Fix notifications pagination on web

* Preserve larger threshold on native
-rw-r--r--src/view/com/notifications/Feed.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx
index e2f12e84f..90f2785b2 100644
--- a/src/view/com/notifications/Feed.tsx
+++ b/src/view/com/notifications/Feed.tsx
@@ -25,6 +25,7 @@ import {LoadMoreRetryBtn} from '#/view/com/util/LoadMoreRetryBtn'
 import {CenteredView} from '#/view/com/util/Views'
 import {FeedItem} from './FeedItem'
 import hairlineWidth = StyleSheet.hairlineWidth
+import {isWeb} from '#/platform/detection'
 
 const EMPTY_FEED_ITEM = {_reactKey: '__empty__'}
 const LOAD_MORE_ERROR_ITEM = {_reactKey: '__load_more_error__'}
@@ -182,7 +183,15 @@ export function Feed({
         refreshing={isPTRing}
         onRefresh={onRefresh}
         onEndReached={onEndReached}
-        onEndReachedThreshold={2}
+        onEndReachedThreshold={
+          /*
+          NOTE:
+          web's intersection observer struggles with the 2x threshold
+          and leads to missed pagination, so we keep it <1
+          -prf
+          */
+          isWeb ? 0.6 : 2
+        }
         onScrolledDownChange={onScrolledDownChange}
         contentContainerStyle={s.contentContainer}
         // @ts-ignore our .web version only -prf