Skip to content

Commit

Permalink
Fix: render comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hookor authored and cuconveniencestore committed May 31, 2024
1 parent fc29b23 commit dcce86d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/post/PostComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const PostComments = ({
{count}
</Length>
{commentData &&
commentData.data.map((comment: CommentType, idx: number) => {
commentData.data.length !== 0 &&
commentData.data.map((comment: CommentType, idx: number) => (
<React.Fragment key={id + idx}>
<Comment
profileUrl={comment.profileUrl}
Expand All @@ -47,8 +48,8 @@ const PostComments = ({
postNum={postNum}
id={comment.id}
/>
</React.Fragment>;
})}
</React.Fragment>
))}
</Container>
)}
{commentData && commentData.data.length === 0 && (
Expand Down

0 comments on commit dcce86d

Please sign in to comment.