From f25f2925ba0cb86b702f8a4b97592e5f2ba2e43c Mon Sep 17 00:00:00 2001 From: Mary Kate Fain Date: Sat, 7 Mar 2026 12:13:50 -0600 Subject: [PATCH] Fix country feeds showing posts oldest-first instead of newest-first Country feeds (iso3166) are social feeds and should display in reverse-chronological order. URL and ISBN comment threads keep the existing oldest-first conversation order. Closes #64 --- src/pages/ExternalContentPage.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/ExternalContentPage.tsx b/src/pages/ExternalContentPage.tsx index b6bd45d3..96908ddb 100644 --- a/src/pages/ExternalContentPage.tsx +++ b/src/pages/ExternalContentPage.tsx @@ -277,8 +277,12 @@ export function ExternalContentPage() { ? topLevel.filter((r) => !isEventMuted(r, muteItems)) : topLevel; - // Sort oldest-first for threaded conversation view (useComments returns newest-first) - const sorted = [...filteredTopLevel].sort((a, b) => a.created_at - b.created_at); + // Country feeds are social feeds (newest-first); other types are threaded conversations (oldest-first) + const sorted = [...filteredTopLevel].sort((a, b) => + content?.type === 'iso3166' + ? b.created_at - a.created_at + : a.created_at - b.created_at + ); return sorted.map((reply) => { const directReplies = commentsData?.getDirectReplies(reply.id) ?? [];