misc: fix Comment.svelte

This commit is contained in:
Xyphyn committed 2023-07-28 16:27:06 -07:00
1 parent 55a3b5cfb8
commit 65a1740322
1 file changed
+6 -6
@@ -8,7 +8,7 @@
Plus, Plus,
Trash, Trash,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
import { insertCommentIntoTree, type CommentNodeI } from './comments' import type { CommentNodeI } from './comments'
import RelativeDate from '$lib/components/util/RelativeDate.svelte' import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import CommentForm from './CommentForm.svelte' import CommentForm from './CommentForm.svelte'
import { page } from '$app/stores' import { page } from '$app/stores'
@@ -163,11 +163,11 @@
{postId} {postId}
parentId={node.comment_view.comment.id} parentId={node.comment_view.comment.id}
on:comment={(e) => { on:comment={(e) => {
insertCommentIntoTree( node.children.push({
getContext('comments:tree'), children: [],
e.detail.comment_view, comment_view: e.detail.comment_view,
false depth: node.depth + 1,
) })
replying = false replying = false
}} }}
/> />