Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/posts/src/views/comments/comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Comments: React.FC = () => {
isError,
isFetching,
isFetchingNextPage,
isRefetching,
fetchNextPage,
hasNextPage
} = useBrowseComments({
Expand All @@ -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 (
<CommentsLayout>
<CommentsHeader>
Expand All @@ -51,7 +55,7 @@ const Comments: React.FC = () => {
)}
</CommentsHeader>
<CommentsContent>
{(isFetching && !isFetchingNextPage) ? (
{shouldShowLoading ? (
<div className="flex h-full items-center justify-center">
<LoadingIndicator size="lg" />
</div>
Expand Down
Loading