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