feat: Add instance changing

This commit is contained in:
Xyphyn committed 2023-07-02 14:27:04 -07:00
1 parent f201123291
commit 3159583654
17 files changed
+142 -35

No files matched your search

-5
View File
@@ -1,5 +0,0 @@
import { lemmy } from '$lib/lemmy.js';
export function load({ params }) {
return lemmy.getCommunity({ name: params.name })
}
+5
View File
@@ -0,0 +1,5 @@
import { getClient } from '$lib/lemmy.js'
export function load({ params }) {
return getClient().getCommunity({ name: params.name })
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { lemmy } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.js'
import type { ListingType, SortType } from 'lemmy-js-client'
export function load(req: any) {
@@ -7,7 +7,7 @@ export function load(req: any) {
const sort: SortType =
(req.url.searchParams.get('sort') as SortType) || 'Active'
return lemmy.getPosts({
return getClient(req.cookies.get('instance_url')).getPosts({
limit: 40,
community_name: req.params.name,
page: page,