fix: post load fails

This commit is contained in:
Xylight committed 2025-09-25 20:56:20 -07:00
1 parent 25960c8b0e
commit 672e6fa388
7 files changed
+108 -107

No files matched your search

@@ -1,4 +1,10 @@
<script lang="ts">
import type { Post } from "$lib/api/types"
import VirtualList from "$lib/app/render/VirtualList.svelte"
import { onMount } from "svelte"
import type { CommentNodeI } from "./comments.svelte"
import CommentTree from "./CommentTree.svelte"
interface Props {
nodes: CommentNodeI[]
post: Post
@@ -43,7 +49,7 @@
>
{#snippet item(index)}
<div class={['px-3 sm:px-6', index % 2 == 1 && '']}>
<Comments
<CommentTree
bind:nodes={() => [nodes[index]], (v) => (nodes[index] = v[0])}
{post}
/>
@@ -1,3 +1,7 @@
import type { Comment, CommentView } from "$lib/api/types"
import { t } from "$lib/app/i18n"
import { SvelteMap } from "svelte/reactivity"
export interface CommentNodeI {
comment_view: CommentView
children: Array<CommentNodeI>
+1 -1
View File
@@ -132,7 +132,7 @@ export interface FeedTypes {
]
}
const feeds = new SvelteMap<keyof FeedTypes, Feed<any, any>>()
export const feeds = new SvelteMap<keyof FeedTypes, Feed<any, any>>()
export function feed<Type extends keyof FeedTypes>(
id: Type,