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