tempfix: recursion crash in comments
This commit is contained in:
2 files changed
+10
-3
No files matched your search
@@ -34,6 +34,13 @@
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
// hack to fix effect bug
|
||||
// TODO find cause
|
||||
let comments = $state(data.comments)
|
||||
$effect(() => {
|
||||
comments = data.comments
|
||||
})
|
||||
|
||||
onMount(async () => {
|
||||
if (
|
||||
!(data.post.value.post_view.read && settings.markPostsAsRead) &&
|
||||
@@ -57,7 +64,7 @@
|
||||
|
||||
async function reloadComments() {
|
||||
loading = true
|
||||
data.comments.value = getClient().getComments({
|
||||
comments = getClient().getComments({
|
||||
page: 1,
|
||||
limit: 25,
|
||||
type_: 'All',
|
||||
@@ -241,7 +248,7 @@
|
||||
</Button>
|
||||
</noscript>
|
||||
{/if}
|
||||
{#await data.comments.value}
|
||||
{#await comments}
|
||||
<div class="flex flex-col gap-4">
|
||||
{#each new Array(10) as _, index}
|
||||
{_}
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function load({ params, url, fetch }) {
|
||||
}),
|
||||
post: new ReactiveState(post),
|
||||
commentSort: new ReactiveState(sort),
|
||||
comments: new ReactiveState((await awaitIfServer(comments)).data),
|
||||
comments: (await awaitIfServer(comments)).data,
|
||||
slots: {
|
||||
sidebar: {
|
||||
component: CommunityCard,
|
||||
|
||||
Reference in new issue
Block a user