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
9 changes: 6 additions & 3 deletions frontend/src/app/components/CommentsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,12 @@ export function CommentsSection({ postId }: { postId: number }) {

// ─── 프로필 이미지 불러오기 ────────────────────────────────────
useEffect(() => {
if (!comments.length) return
if (!rawComments.length) return
const ids = Array.from(
new Set([...comments.map((c) => c.userId), ...comments.flatMap((c) => c.replies.map((r) => r.userId))]),
new Set([
...rawComments.map((c) => c.userId),
...rawComments.flatMap((c) => c.replies.map((r) => r.userId)),
]),
)
async function fetchUserImages() {
const map: Record<number, string> = {}
Expand All @@ -354,7 +357,7 @@ export function CommentsSection({ postId }: { postId: number }) {
setUserImages(map)
}
fetchUserImages()
}, [comments])
}, [rawComments])

// ─── 렌더링 ────────────────────────────────────────────────────
return (
Expand Down
Loading