parent
4355f0fd9a
commit
3fde1bea1b
|
@ -107,6 +107,7 @@ export const FeedsScreen = withAuthRequired(function FeedsScreenImpl(
|
||||||
refetch: refetchPopularFeeds,
|
refetch: refetchPopularFeeds,
|
||||||
fetchNextPage: fetchNextPopularFeedsPage,
|
fetchNextPage: fetchNextPopularFeedsPage,
|
||||||
isFetchingNextPage: isPopularFeedsFetchingNextPage,
|
isFetchingNextPage: isPopularFeedsFetchingNextPage,
|
||||||
|
hasNextPage: hasNextPopularFeedsPage,
|
||||||
} = useGetPopularFeedsQuery()
|
} = useGetPopularFeedsQuery()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
|
@ -154,6 +155,22 @@ export const FeedsScreen = withAuthRequired(function FeedsScreenImpl(
|
||||||
await refetchPopularFeeds()
|
await refetchPopularFeeds()
|
||||||
setIsPTR(false)
|
setIsPTR(false)
|
||||||
}, [setIsPTR, refetchPopularFeeds])
|
}, [setIsPTR, refetchPopularFeeds])
|
||||||
|
const onEndReached = React.useCallback(() => {
|
||||||
|
if (
|
||||||
|
isPopularFeedsFetching ||
|
||||||
|
isUserSearching ||
|
||||||
|
!hasNextPopularFeedsPage ||
|
||||||
|
popularFeedsError
|
||||||
|
)
|
||||||
|
return
|
||||||
|
fetchNextPopularFeedsPage()
|
||||||
|
}, [
|
||||||
|
isPopularFeedsFetching,
|
||||||
|
isUserSearching,
|
||||||
|
popularFeedsError,
|
||||||
|
hasNextPopularFeedsPage,
|
||||||
|
fetchNextPopularFeedsPage,
|
||||||
|
])
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
React.useCallback(() => {
|
React.useCallback(() => {
|
||||||
|
@ -474,9 +491,7 @@ export const FeedsScreen = withAuthRequired(function FeedsScreenImpl(
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
initialNumToRender={10}
|
initialNumToRender={10}
|
||||||
onEndReached={() =>
|
onEndReached={onEndReached}
|
||||||
isUserSearching ? undefined : fetchNextPopularFeedsPage()
|
|
||||||
}
|
|
||||||
// @ts-ignore our .web version only -prf
|
// @ts-ignore our .web version only -prf
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue