diff --git a/src/routes/post/[instance]/[id]/+page.svelte b/src/routes/post/[instance]/[id]/+page.svelte index d87416ec..124fc6b1 100644 --- a/src/routes/post/[instance]/[id]/+page.svelte +++ b/src/routes/post/[instance]/[id]/+page.svelte @@ -30,6 +30,8 @@ import PostLink from '$lib/components/lemmy/post/PostLink.svelte' import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' + import type { CommentSortType } from 'lemmy-js-client' + import MultiSelect from '$lib/components/input/MultiSelect.svelte' export let data @@ -47,8 +49,22 @@ }) let commentsPage = 1 + let commentSort: CommentSortType = 'Hot' let loading = false let moreComments = true + + async function reloadComments() { + commentsPage = 1 + + data.streamed.comments = getClient().getComments({ + auth: $authData?.token, + max_depth: 3, + page: commentsPage, + limit: 25, + post_id: data.post.post_view.post.id, + sort: commentSort, + }) + } @@ -147,6 +163,11 @@ {postData.counts.comments} + {#await data.streamed.comments}