misc: Fix comment loading

This commit is contained in:
Xyphyn committed 2023-07-07 15:18:12 -07:00
1 parent 5f7741768b
commit 810d6011a5
2 files changed
+8 -12

No files matched your search

@@ -38,19 +38,13 @@
const newComments = await getClient().getComments({
auth: $authData?.token,
max_depth: 3,
limit: 10,
parent_id: parent.comment_view.comment.id,
})
parent.children = buildCommentsTree(
newComments.comments.filter(
(comment) => comment.comment.id != parent.comment_view.comment.id
),
true
).map((node) => ({
children: node.children,
comment_view: node.comment_view,
depth: node.depth + parent.depth,
}))
parent.children = buildCommentsTree(newComments.comments, true).find(
(c) => c.comment_view.comment.id == parent.comment_view.comment.id
)!.children
loadingChildren = false
}