impr: enhance preload logic

This commit is contained in:
Xylight committed 2025-10-09 20:25:46 -07:00
1 parent 89a764ef06
commit 039c51c360
4 files changed
+38 -24

No files matched your search

+13 -3
View File
@@ -9,7 +9,10 @@ import type {
GetPersonDetailsResponse,
GetPost,
GetPosts,
ListCommunitiesResponse,
ListingType,
PostView,
SortType,
TopicView,
} from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
@@ -28,9 +31,7 @@ export class Feed<Params, Response> {
}
async load(params: Params) {
if (
!recursiveEqual(params, this.#lastParams)
) {
if (!recursiveEqual(params, this.#lastParams)) {
this.#data = undefined
}
this.#lastParams = params
@@ -103,6 +104,15 @@ export interface FeedTypes {
}
},
]
'/explore/communities': [
{
type: ListingType
sort: SortType
query: string
page: number
},
ListCommunitiesResponse,
]
'/f/[id]': [
GetPosts,