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
This commit is contained in:
Mary Kate Fain
2026-03-07 12:13:50 -06:00
parent 60e3ead6ed
commit f25f2925ba
+6 -2
View File
@@ -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) ?? [];