fix: piefed page cursor types won't work

This commit is contained in:
Xylight committed 2025-09-21 20:51:48 -07:00
1 parent 9a27e95a5f
commit 7f9d8c6f86
11 files changed
+504 -66

No files matched your search

+8 -5
View File
@@ -14,11 +14,14 @@ export async function load({ url, fetch, route }) {
const listingType: ListingType =
(url.searchParams.get('type') as ListingType) || settings.defaultSort.feed
const feedData = feed(route.id, async (params) => ({
...(await client({ func: fetch }).getPosts(params)),
params: params,
client: {},
})).load({
const feedData = feed(route.id, async (params) => {
const posts = await client({ func: fetch }).getPosts(params)
return {
...posts,
params: { ...params, page_cursor: posts.next_page },
client: {},
}
}).load({
page_cursor: cursor,
sort: sort,
type_: listingType,
+3 -3
View File
@@ -51,13 +51,13 @@
</svelte:head>
<PostListShell
posts={data.posts}
cursor={data.next_page}
bind:posts={data.posts}
bind:cursor={data.next_page}
bind:client={data.client}
getParams={data.params}
params={{
sort: data.params.sort!,
}}
client={data.client}
>
{#snippet extended()}
<CommunityHeader
+1 -1
View File
@@ -22,7 +22,7 @@ export async function load({ params, fetch, url, route }) {
community: await communityPromise,
posts: (await postPromise).posts,
next_page: (await postPromise).next_page,
params: p,
params: { ...p, page_cursor: (await postPromise).next_page },
client: {},
}
}).load({
+1 -1
View File
@@ -26,9 +26,9 @@
</svelte:head>
<PostListShell
client={data.client}
posts={data.posts}
cursor={data.next_page}
client={data.client}
getParams={data.params}
params={{
sort: data.params.sort!,
+5 -2
View File
@@ -19,10 +19,13 @@ export async function load({ url, fetch, route, params }) {
(i) => i.feeds.find((j) => j.id.toString() == p.feed_id!),
)
const postPromise = piefed.getPosts(p)
return {
...(await piefed.getPosts(p)),
posts: (await postPromise).posts,
next_page: (await postPromise).next_page,
feed: piefedFeedData,
params: p,
params: { ...p, page_cursor: (await postPromise).next_page },
client: {},
}
}).load({
+4 -2
View File
@@ -19,10 +19,12 @@ export async function load({ url, fetch, route, params }) {
include_communities: true,
}).then((i) => i.topics.find((j) => j.id.toString() == p.topic_id!))
const posts = await piefed.getPosts(p)
return {
...(await piefed.getPosts(p)),
...posts,
topic: piefedTopicData,
params: p,
params: { ...p, page_cursor: posts.next_page },
client: {},
}
}).load({