diff --git a/package.json b/package.json index 41287700..a226f210 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photon-lemmy", - "version": "0.9.3", + "version": "0.9.4", "private": true, "scripts": { "dev": "vite dev", diff --git a/src/lib/components/markdown/MarkdownEditor.svelte b/src/lib/components/markdown/MarkdownEditor.svelte index 612b6733..82f11c77 100644 --- a/src/lib/components/markdown/MarkdownEditor.svelte +++ b/src/lib/components/markdown/MarkdownEditor.svelte @@ -8,6 +8,7 @@ import Modal from '$lib/components/ui/modal/Modal.svelte' import { toast } from '$lib/components/ui/toasts/toasts.js' import { uploadImage } from '$lib/lemmy.js' + import type { Community, Person } from 'lemmy-js-client' import { createEventDispatcher } from 'svelte' import { CodeBracket, diff --git a/src/routes/saved/+page.svelte b/src/routes/saved/+page.svelte index 9eaf392b..48ad6d10 100644 --- a/src/routes/saved/+page.svelte +++ b/src/routes/saved/+page.svelte @@ -16,10 +16,10 @@ - Saved posts + Saved -

Saved Posts

+

Saved

{#if !data.data || (data.data?.length ?? 0) == 0}

diff --git a/src/routes/saved/+page.ts b/src/routes/saved/+page.ts index c66485cf..bde25818 100644 --- a/src/routes/saved/+page.ts +++ b/src/routes/saved/+page.ts @@ -1,6 +1,6 @@ import { profile } from '$lib/auth.js' import { getClient } from '$lib/lemmy.js' -import type { CommentView, PostView } from 'lemmy-js-client' +import type { CommentSortType, CommentView, ListingType, PostView, SortType } from 'lemmy-js-client' import { get } from 'svelte/store' function getSavedItemPublished(item: PostView | CommentView) { @@ -17,22 +17,19 @@ export async function load({ url, fetch }) { const client = getClient(undefined, fetch) - const [posts, comments] = await Promise.all([ - client.getPosts({ - saved_only: true, - auth: get(profile)!.jwt, - limit: 20, - page: page, - sort: 'New', - }), + const params = { + auth: get(profile)!.jwt!, + saved_only: true, + limit: 20, + page: page, + sort: 'New' as SortType & CommentSortType, + type_: 'All' as ListingType + } - client.getComments({ - saved_only: true, - auth: get(profile)!.jwt, - limit: 20, - page: page, - sort: 'New', - }), + const [posts, comments] = await Promise.all([ + client.getPosts(params), + + client.getComments(params), ]) const everything = [...posts.posts, ...comments.comments].sort(