Fix notifications pagination on web (#4400)

* Fix notifications pagination on web

* Preserve larger threshold on native
zio/stable
Paul Frazee 2024-06-06 12:10:50 -07:00 committed by GitHub
parent ac25e43bef
commit fef16e060f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import {LoadMoreRetryBtn} from '#/view/com/util/LoadMoreRetryBtn'
import {CenteredView} from '#/view/com/util/Views' import {CenteredView} from '#/view/com/util/Views'
import {FeedItem} from './FeedItem' import {FeedItem} from './FeedItem'
import hairlineWidth = StyleSheet.hairlineWidth import hairlineWidth = StyleSheet.hairlineWidth
import {isWeb} from '#/platform/detection'
const EMPTY_FEED_ITEM = {_reactKey: '__empty__'} const EMPTY_FEED_ITEM = {_reactKey: '__empty__'}
const LOAD_MORE_ERROR_ITEM = {_reactKey: '__load_more_error__'} const LOAD_MORE_ERROR_ITEM = {_reactKey: '__load_more_error__'}
@ -182,7 +183,15 @@ export function Feed({
refreshing={isPTRing} refreshing={isPTRing}
onRefresh={onRefresh} onRefresh={onRefresh}
onEndReached={onEndReached} 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} onScrolledDownChange={onScrolledDownChange}
contentContainerStyle={s.contentContainer} contentContainerStyle={s.contentContainer}
// @ts-ignore our .web version only -prf // @ts-ignore our .web version only -prf