diff --git a/apps/posts/src/views/comments/comments.tsx b/apps/posts/src/views/comments/comments.tsx index 2ac39d377f1..2436a091a6a 100644 --- a/apps/posts/src/views/comments/comments.tsx +++ b/apps/posts/src/views/comments/comments.tsx @@ -29,6 +29,7 @@ const Comments: React.FC = () => { isError, isFetching, isFetchingNextPage, + isRefetching, fetchNextPage, hasNextPage } = useBrowseComments({ @@ -38,6 +39,9 @@ const Comments: React.FC = () => { const {knownPosts, knownMembers} = useKnownFilterValues({comments: data?.comments ?? []}); + // If we are fetching comments, but not fetching the next page and not refetching, we should show the loading indicator + const shouldShowLoading = isFetching && !isFetchingNextPage && !isRefetching; + return ( @@ -51,7 +55,7 @@ const Comments: React.FC = () => { )} - {(isFetching && !isFetchingNextPage) ? ( + {shouldShowLoading ? (