mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
fix(ui): add defensive checks for undefined replies in video page comments
This commit is contained in:
@@ -1220,7 +1220,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi
|
|||||||
...v,
|
...v,
|
||||||
comments: v.comments.map((c) =>
|
comments: v.comments.map((c) =>
|
||||||
c.id === parentId
|
c.id === parentId
|
||||||
? { ...c, replies: [...c.replies, optimisticReply] }
|
? { ...c, replies: [...(c.replies || []), optimisticReply] }
|
||||||
: c
|
: c
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@@ -1282,7 +1282,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi
|
|||||||
...v,
|
...v,
|
||||||
comments: v.comments.map((c) =>
|
comments: v.comments.map((c) =>
|
||||||
c.id === parentId
|
c.id === parentId
|
||||||
? { ...c, replies: c.replies.filter(r => r.id !== tempId) }
|
? { ...c, replies: (c.replies || []).filter(r => r.id !== tempId) }
|
||||||
: c
|
: c
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@@ -1303,7 +1303,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi
|
|||||||
...v,
|
...v,
|
||||||
comments: v.comments.map((c) =>
|
comments: v.comments.map((c) =>
|
||||||
c.id === parentId
|
c.id === parentId
|
||||||
? { ...c, replies: c.replies.filter(r => r.id !== tempId) }
|
? { ...c, replies: (c.replies || []).filter(r => r.id !== tempId) }
|
||||||
: c
|
: c
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user