be more strict about onStartReached
This commit is contained in:
@@ -30,6 +30,8 @@ import {NewMessagesPill} from '#/components/dms/NewMessagesPill'
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
|
const MAX_TO_RENDER = isNative ? 30 : 60
|
||||||
|
|
||||||
function MaybeLoader({isLoading}: {isLoading: boolean}) {
|
function MaybeLoader({isLoading}: {isLoading: boolean}) {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
@@ -183,7 +185,7 @@ export function MessagesList({
|
|||||||
}, [isDragging])
|
}, [isDragging])
|
||||||
|
|
||||||
const onStartReached = useCallback(() => {
|
const onStartReached = useCallback(() => {
|
||||||
if (hasScrolled) {
|
if (hasScrolled && convoState.items.length >= MAX_TO_RENDER) {
|
||||||
convoState.fetchMessageHistory()
|
convoState.fetchMessageHistory()
|
||||||
}
|
}
|
||||||
}, [convoState, hasScrolled])
|
}, [convoState, hasScrolled])
|
||||||
|
|||||||
Reference in New Issue
Block a user