Fix: dont incorrectly mark a feed empty based only on the first page (#2298)
parent
2c37d47cf0
commit
28e0df595f
|
@ -95,10 +95,13 @@ let Feed = ({
|
|||
isFetchingNextPage,
|
||||
fetchNextPage,
|
||||
} = usePostFeedQuery(feed, feedParams, opts)
|
||||
const isEmpty = !isFetching && !data?.pages[0]?.slices.length
|
||||
if (data?.pages[0]) {
|
||||
lastFetchRef.current = data?.pages[0].fetchedAt
|
||||
}
|
||||
const isEmpty = React.useMemo(
|
||||
() => !isFetching && !data?.pages?.some(page => page.slices.length),
|
||||
[isFetching, data],
|
||||
)
|
||||
|
||||
const checkForNew = React.useCallback(async () => {
|
||||
if (!data?.pages[0] || isFetching || !onHasNew || !enabled) {
|
||||
|
|
Loading…
Reference in New Issue