fix: view wont update on new comments, close #611
This commit is contained in:
2 files changed
+7
-7
No files matched your search
@@ -31,6 +31,7 @@
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import { fly } from 'svelte/transition'
|
||||
import CommentProvider from './CommentProvider.svelte'
|
||||
import { ReactiveState } from '$lib/promise.svelte'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -261,16 +262,17 @@
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{:then comments}
|
||||
{:then passedComments}
|
||||
{@const comments = new ReactiveState(passedComments)}
|
||||
<CommentProvider
|
||||
{comments}
|
||||
comments={comments.value}
|
||||
post={data.post.value}
|
||||
focus={data.thread.value.focus}
|
||||
onupdate={reloadComments}
|
||||
bind:sort={data.commentSort.value}
|
||||
virtualize={!page.url.searchParams.get('noVirtualize')}
|
||||
/>
|
||||
{#if comments.comments.length == 0}
|
||||
{#if comments.value.comments.length == 0}
|
||||
<Placeholder
|
||||
icon={ChatBubbleLeftRight}
|
||||
title={$t('routes.post.emptyComments.title')}
|
||||
|
||||
Reference in new issue
Block a user