fix: profile submissions broken
This commit is contained in:
1 parent
52888ba697
commit
6e0316b787
4 files changed
+9
-8
No files matched your search
@@ -343,9 +343,9 @@
|
||||
>
|
||||
{#key data.items}
|
||||
{#each data.items.value as item}
|
||||
{#if isCommentView(item)}
|
||||
{#if isCommentView(item) && data.filters.value.type == 'comments'}
|
||||
<CommentItem comment={item} />
|
||||
{:else if !isCommentView(item)}
|
||||
{:else if !isCommentView(item) && data.filters.value.type == 'posts'}
|
||||
<Post post={item} />
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getClient } from '$lib/lemmy.svelte.js'
|
||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||
import type { SortType } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView, SortType } from 'lemmy-js-client'
|
||||
|
||||
export async function load({ params, url, fetch }) {
|
||||
const page = Number(url.searchParams.get('page')) || 1
|
||||
@@ -18,7 +18,8 @@ export async function load({ params, url, fetch }) {
|
||||
sort: sort,
|
||||
})
|
||||
|
||||
const items = type == 'posts' ? user.posts : user.comments
|
||||
const items: (PostView | CommentView)[] =
|
||||
type == 'posts' ? user.posts : user.comments
|
||||
|
||||
return {
|
||||
filters: new ReactiveState({
|
||||
|
||||
Reference in new issue
Block a user