diff --git a/src/state/queries/usePostThread/index.ts b/src/state/queries/usePostThread/index.ts index f52931f040..933881251e 100644 --- a/src/state/queries/usePostThread/index.ts +++ b/src/state/queries/usePostThread/index.ts @@ -79,6 +79,7 @@ export function usePostThread({ hasSession, showMuted: state.shownHiddenReplyKinds.has(HiddenReplyKind.Muted), showHidden: state.shownHiddenReplyKinds.has(HiddenReplyKind.Hidden), + view: params.view, }) }, [ query.data, @@ -86,6 +87,7 @@ export function usePostThread({ moderationOpts, hasSession, state.shownHiddenReplyKinds, + params.view, ]) const mutator = createCacheMutator({ diff --git a/src/state/queries/usePostThread/traversal.ts b/src/state/queries/usePostThread/traversal.ts index e9c92781f1..feceb9dc67 100644 --- a/src/state/queries/usePostThread/traversal.ts +++ b/src/state/queries/usePostThread/traversal.ts @@ -6,6 +6,7 @@ import { import { HiddenReplyKind, + type PostThreadParams, type Slice, type TraversalMetadata, } from '#/state/queries/usePostThread/types' @@ -25,12 +26,14 @@ export function traverse( hasSession, showMuted, showHidden, + view, }: { threadgateHiddenReplies: Set moderationOpts: ModerationOpts hasSession: boolean showMuted: boolean showHidden: boolean + view: PostThreadParams['view'] }, ) { const items: Slice[] = [] @@ -347,11 +350,14 @@ export function traverse( } /* + * Tree-view only. + * * If there's an upcoming parent read more, this branch is part of the * last branch of the sub-tree, and the item itself is the last child, * insert the parent "read more". */ if ( + view === 'tree' && metadata.upcomingParentReadMore && metadata.isPartOfLastBranchFromDepth === metadata.upcomingParentReadMore.depth &&