From dd01bdd91dff93dd9ba120c9870133a17afe6ea1 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 7 May 2025 15:44:40 -0500 Subject: [PATCH] Handle first reply under highlighted/composer --- src/state/queries/useGetPostThreadV2.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/state/queries/useGetPostThreadV2.ts b/src/state/queries/useGetPostThreadV2.ts index 3d49289237..cb46865aa5 100644 --- a/src/state/queries/useGetPostThreadV2.ts +++ b/src/state/queries/useGetPostThreadV2.ts @@ -363,9 +363,13 @@ export function filterAndSort( i = branch.end continue traversal } else if (AppBskyFeedDefs.isThreadItemPost(item)) { + const lastSlice = slices[slices.length - 1] + const isFirstReply = + lastSlice.type === 'replyComposer' || + (lastSlice.type === 'threadSlice' && lastSlice.slice.depth === 0) const parent = views.post({ item, - oneUp: thread[i - 1], + oneUp: isFirstReply ? undefined : thread[i - 1], oneDown: thread[i + 1], moderationOpts, })