From d92f6f6514ea719f5edaad2f479172a282f395e6 Mon Sep 17 00:00:00 2001 From: Astra Date: Mon, 21 Apr 2025 15:29:58 +0900 Subject: [PATCH] Proper chronological feed --- config.ts | 6 +++--- src/lib/pdsfetch.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.ts b/config.ts index b8284a6..fe28a5a 100644 --- a/config.ts +++ b/config.ts @@ -15,10 +15,10 @@ export class Config { static readonly FRONTEND_URL: string = "https://deer.social"; /** - * Maximum number of posts to fetch from the PDS per user - * @default 10 + * Maximum number of posts to show in the feed (across all users) + * @default 100 */ - static readonly MAX_POSTS_PER_USER: number = 22; + static readonly MAX_POSTS: number = 100; /** * Footer text for the dashboard diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts index 0dec969..aa3fc85 100644 --- a/src/lib/pdsfetch.ts +++ b/src/lib/pdsfetch.ts @@ -167,7 +167,7 @@ const fetchPosts = async (did: string) => { params: { repo: did as At.Identifier, collection: "app.bsky.feed.post", - limit: Config.MAX_POSTS_PER_USER, + limit: Config.MAX_POSTS, }, }); return { @@ -238,7 +238,7 @@ const fetchAllPosts = async () => { }) ); posts.sort((a, b) => b.timestamp - a.timestamp); - return posts; + return posts.slice(0, Config.MAX_POSTS); }; export { fetchAllPosts, getAllMetadataFromPds, Post }; export type { AccountMetadata };