Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix orphan replies in linear mode (#2578)

authored by

dan and committed by
GitHub
21846ce5 d25b17ab

+12 -4
+12 -4
src/view/com/post-thread/PostThread.tsx
··· 157 157 const posts = React.useMemo(() => { 158 158 let arr = [TOP_COMPONENT].concat( 159 159 Array.from( 160 - flattenThreadSkeleton(sortThread(thread, threadViewPrefs), hasSession), 160 + flattenThreadSkeleton( 161 + sortThread(thread, threadViewPrefs), 162 + hasSession, 163 + treeView, 164 + ), 161 165 ), 162 166 ) 163 167 if (arr.length > maxVisible) { ··· 167 171 arr.push(BOTTOM_COMPONENT) 168 172 } 169 173 return arr 170 - }, [thread, maxVisible, threadViewPrefs, hasSession]) 174 + }, [thread, treeView, maxVisible, threadViewPrefs, hasSession]) 171 175 172 176 /** 173 177 * NOTE ··· 486 490 function* flattenThreadSkeleton( 487 491 node: ThreadNode, 488 492 hasSession: boolean, 493 + treeView: boolean, 489 494 ): Generator<YieldedItem, void> { 490 495 if (node.type === 'post') { 491 496 if (node.parent) { 492 - yield* flattenThreadSkeleton(node.parent, hasSession) 497 + yield* flattenThreadSkeleton(node.parent, hasSession, treeView) 493 498 } else if (node.ctx.isParentLoading) { 494 499 yield PARENT_SPINNER 495 500 } ··· 502 507 } 503 508 if (node.replies?.length) { 504 509 for (const reply of node.replies) { 505 - yield* flattenThreadSkeleton(reply, hasSession) 510 + yield* flattenThreadSkeleton(reply, hasSession, treeView) 511 + if (!treeView && !node.ctx.isHighlightedPost) { 512 + break 513 + } 506 514 } 507 515 } else if (node.ctx.isChildLoading) { 508 516 yield CHILD_SPINNER