fix: comments wont appear when replying nested

This commit is contained in:
Xyphyn committed 2023-08-27 12:45:05 -07:00
1 parent 1826aad235
commit 5ac8297457
3 files changed
+10 -7

No files matched your search

@@ -179,11 +179,14 @@
{postId}
parentId={node.comment_view.comment.id}
on:comment={(e) => {
node.children.push({
children: [],
comment_view: e.detail.comment_view,
depth: node.depth + 1,
})
node.children = [
{
children: [],
comment_view: e.detail.comment_view,
depth: node.depth + 1,
},
...node.children,
]
replying = false
}}
/>
@@ -43,7 +43,7 @@
value = ''
toast({
content: 'Your comment was added. You may need to refresh to see it.',
content: 'Your comment was submitted.',
type: 'success',
})
} catch (err) {
@@ -104,7 +104,7 @@
{#each nodes as node (node.comment_view.comment.id)}
<Comment
postId={post.id}
{node}
bind:node
open={true}
op={post.creator_id == node.comment_view.creator.id}
>