fix: view wont update on new comments, close #611

This commit is contained in:
James Xylight committed 2025-07-25 15:42:47 -07:00
1 parent 5b9777cc7a
commit 3b85d63004
2 files changed
+7 -7

No files matched your search

@@ -38,7 +38,7 @@
let {
post,
comments: passedComments,
comments,
sort = $bindable(),
onupdate,
focus,
@@ -46,8 +46,6 @@
}: Props = $props()
let commenting = $state(false)
let comments = $derived(passedComments)
let tree = $state(buildCommentsTree(comments.comments))
$effect(() => {
tree = buildCommentsTree(comments.comments)
@@ -120,7 +118,7 @@
<CommentForm
postId={post.post_view.post.id}
oncomment={comment => {
comments.comments.push(comment.comment_view)
comments.comments.unshift(comment.comment_view)
}}
onfocus={() => (commenting = true)}
tools={commenting}