An ATproto social media client -- with an independent Appview.
6
fork

Configure Feed

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

Fix: only apply self-thread load-more behavior on the outer edge of the reply tree (#4559)

authored by

Paul Frazee and committed by
GitHub
fb76265f 5f5d8450

+11 -2
+11 -2
src/state/queries/post-thread.ts
··· 31 31 getEmbeddedPost, 32 32 } from './util' 33 33 34 + const REPLY_TREE_DEPTH = 10 34 35 const RQKEY_ROOT = 'post-thread' 35 36 export const RQKEY = (uri: string) => [RQKEY_ROOT, uri] 36 37 type ThreadViewNode = AppBskyFeedGetPostThread.OutputSchema['thread'] ··· 90 91 gcTime: 0, 91 92 queryKey: RQKEY(uri || ''), 92 93 async queryFn() { 93 - const res = await agent.getPostThread({uri: uri!, depth: 10}) 94 + const res = await agent.getPostThread({ 95 + uri: uri!, 96 + depth: REPLY_TREE_DEPTH, 97 + }) 94 98 if (res.success) { 95 99 const thread = responseToThreadNodes(res.data.thread) 96 100 annotateSelfThread(thread) ··· 287 291 selfThreadNode.ctx.isSelfThread = true 288 292 } 289 293 const last = selfThreadNodes[selfThreadNodes.length - 1] 290 - if (last && last.post.replyCount && !last.replies?.length) { 294 + if ( 295 + last && 296 + last.ctx.depth === REPLY_TREE_DEPTH && // at the edge of the tree depth 297 + last.post.replyCount && // has replies 298 + !last.replies?.length // replies were not hydrated 299 + ) { 291 300 last.ctx.hasMoreSelfThread = true 292 301 } 293 302 }