This commit is contained in:
Xyphyn committed 2023-07-25 11:30:27 -07:00
1 parent 7ea6d141be
commit 90587cfa26
5 files changed
+29 -18

No files matched your search

+3 -3
View File
@@ -2,13 +2,13 @@ import { authData, getClient } from '$lib/lemmy.js'
import type { ListingType } from 'lemmy-js-client'
import { get } from 'svelte/store'
export function load({ url }) {
export async function load({ url }) {
const type = url.searchParams.get('type') as ListingType
const page = Number(url.searchParams.get('page')) || 1
const query = url.searchParams.get('q')
if (query) {
return getClient().search({
return await getClient().search({
limit: 40,
page: page,
sort: 'TopAll',
@@ -18,7 +18,7 @@ export function load({ url }) {
auth: get(authData)?.token,
})
} else {
return getClient().listCommunities({
return await getClient().listCommunities({
limit: 40,
page: page,
sort: 'TopAll',