fix: show total activity count in global feed counter
The counter now shows "50 of 16398 activities" using the total from feed.json, matching the previous behaviour where all activities were loaded upfront.
This commit is contained in:
@@ -269,12 +269,13 @@ interface FeedPage {
|
||||
*/
|
||||
export async function loadCombinedFeed(
|
||||
baseUrl: string,
|
||||
): Promise<{ activities: ActivitySummary[]; remainingPages: number } | null> {
|
||||
): Promise<{ activities: ActivitySummary[]; remainingPages: number; totalActivities: number } | null> {
|
||||
try {
|
||||
const feed = await fetchJSON<FeedPage>(`${baseUrl}data/feed.json`);
|
||||
return {
|
||||
activities: feed.activities ?? [],
|
||||
remainingPages: (feed.total_pages ?? 1) - 1,
|
||||
totalActivities: feed.total_activities ?? 0,
|
||||
};
|
||||
} catch {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user