From 89fa895a0a1091b416e73c09822697c0b443b5c7 Mon Sep 17 00:00:00 2001 From: Hampus Date: Thu, 8 Oct 2026 20:04:53 +0200 Subject: [PATCH] fix(forum): keep closed posts visible without a reload (#3309) --- fluxer_app/src/features/forum/hooks/useForumPosts.ts | 2 +- fluxer_app/src/features/forum/utils/ForumPostList.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fluxer_app/src/features/forum/hooks/useForumPosts.ts b/fluxer_app/src/features/forum/hooks/useForumPosts.ts index 1ead51947..edaf6008d 100644 --- a/fluxer_app/src/features/forum/hooks/useForumPosts.ts +++ b/fluxer_app/src/features/forum/hooks/useForumPosts.ts @@ -38,7 +38,7 @@ export function getForumPostListView(forum: Channel): ForumPostListView { } const list = ForumPosts.getList(forum.id, 'archived'); const {pinned, active, archived} = buildForumPostList({ - active: ChannelThreads.getActiveThreadsForParent(forum.id), + known: ChannelThreads.getThreadsForParent(forum.id), extra: resolvePosts(forum.id, list.ids), sortOrder: ForumPosts.getSortOrder(forum), tagIds: ForumPosts.getTagFilter(forum.id), diff --git a/fluxer_app/src/features/forum/utils/ForumPostList.ts b/fluxer_app/src/features/forum/utils/ForumPostList.ts index 2ed939abc..4a816f4bf 100644 --- a/fluxer_app/src/features/forum/utils/ForumPostList.ts +++ b/fluxer_app/src/features/forum/utils/ForumPostList.ts @@ -30,7 +30,7 @@ export function matchesTagFilter( } export interface ForumPostListInput { - active: ReadonlyArray; + known: ReadonlyArray; extra: ReadonlyArray; sortOrder: ForumSortOrderType; tagIds: ReadonlyArray; @@ -44,7 +44,7 @@ export interface ForumPostListResult { } export function buildForumPostList({ - active, + known, extra, sortOrder, tagIds, @@ -54,7 +54,7 @@ export function buildForumPostList({ const activePosts: Array = []; const archivedPosts: Array = []; let pinned: Channel | null = null; - for (const post of [...active, ...extra]) { + for (const post of [...known, ...extra]) { if (seen.has(post.id)) continue; seen.add(post.id); if (!matchesTagFilter(post.appliedTags, tagIds, tagSetting)) continue; @@ -67,5 +67,6 @@ export function buildForumPostList({ const byKey = (a: Channel, b: Channel) => SnowflakeUtils.compare(postSortKey(b, sortOrder), postSortKey(a, sortOrder)); activePosts.sort(byKey); + archivedPosts.sort(byKey); return {pinned, active: activePosts, archived: archivedPosts}; }