Feed bugfixes (#2204)
* Dont show both an error and empty message in the feed * Add a sanity check when attempting to fill the first 30zio/stable
parent
e3ba014be0
commit
8245e56747
|
@ -114,7 +114,13 @@ export function useNotificationFeedQuery(opts?: {enabled?: boolean}) {
|
||||||
count += page.items.length
|
count += page.items.length
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) {
|
if (
|
||||||
|
!isFetching &&
|
||||||
|
hasNextPage &&
|
||||||
|
count < PAGE_SIZE &&
|
||||||
|
numEmpties < 3 &&
|
||||||
|
(data?.pages.length || 0) < 6
|
||||||
|
) {
|
||||||
query.fetchNextPage()
|
query.fetchNextPage()
|
||||||
}
|
}
|
||||||
}, [query])
|
}, [query])
|
||||||
|
|
|
@ -291,7 +291,13 @@ export function usePostFeedQuery(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFetching && hasNextPage && count < PAGE_SIZE && numEmpties < 3) {
|
if (
|
||||||
|
!isFetching &&
|
||||||
|
hasNextPage &&
|
||||||
|
count < PAGE_SIZE &&
|
||||||
|
numEmpties < 3 &&
|
||||||
|
(data?.pages.length || 0) < 6
|
||||||
|
) {
|
||||||
query.fetchNextPage()
|
query.fetchNextPage()
|
||||||
}
|
}
|
||||||
}, [query])
|
}, [query])
|
||||||
|
|
|
@ -167,8 +167,7 @@ let Feed = ({
|
||||||
if (isFetched) {
|
if (isFetched) {
|
||||||
if (isError && isEmpty) {
|
if (isError && isEmpty) {
|
||||||
arr = arr.concat([ERROR_ITEM])
|
arr = arr.concat([ERROR_ITEM])
|
||||||
}
|
} else if (isEmpty) {
|
||||||
if (isEmpty) {
|
|
||||||
arr = arr.concat([EMPTY_FEED_ITEM])
|
arr = arr.concat([EMPTY_FEED_ITEM])
|
||||||
} else if (data) {
|
} else if (data) {
|
||||||
for (const page of data?.pages) {
|
for (const page of data?.pages) {
|
||||||
|
|
Loading…
Reference in New Issue