Proper chronological feed
This commit is contained in:
parent
04de4c1841
commit
d92f6f6514
2 changed files with 5 additions and 5 deletions
|
@ -15,10 +15,10 @@ export class Config {
|
||||||
static readonly FRONTEND_URL: string = "https://deer.social";
|
static readonly FRONTEND_URL: string = "https://deer.social";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of posts to fetch from the PDS per user
|
* Maximum number of posts to show in the feed (across all users)
|
||||||
* @default 10
|
* @default 100
|
||||||
*/
|
*/
|
||||||
static readonly MAX_POSTS_PER_USER: number = 22;
|
static readonly MAX_POSTS: number = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Footer text for the dashboard
|
* Footer text for the dashboard
|
||||||
|
|
|
@ -167,7 +167,7 @@ const fetchPosts = async (did: string) => {
|
||||||
params: {
|
params: {
|
||||||
repo: did as At.Identifier,
|
repo: did as At.Identifier,
|
||||||
collection: "app.bsky.feed.post",
|
collection: "app.bsky.feed.post",
|
||||||
limit: Config.MAX_POSTS_PER_USER,
|
limit: Config.MAX_POSTS,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
@ -238,7 +238,7 @@ const fetchAllPosts = async () => {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
posts.sort((a, b) => b.timestamp - a.timestamp);
|
posts.sort((a, b) => b.timestamp - a.timestamp);
|
||||||
return posts;
|
return posts.slice(0, Config.MAX_POSTS);
|
||||||
};
|
};
|
||||||
export { fetchAllPosts, getAllMetadataFromPds, Post };
|
export { fetchAllPosts, getAllMetadataFromPds, Post };
|
||||||
export type { AccountMetadata };
|
export type { AccountMetadata };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue