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