Improve thread loading (#4402)

* Increase the number of posts loaded when a self-thread is present

* Increase depth to 10, detect cutoffs on self-threads and show continue link

* Stacky the avis
This commit is contained in:
Paul Frazee 2024-06-11 11:30:38 -07:00 committed by GitHub
parent 4b6609d48b
commit 46e12c6d34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 112 additions and 2 deletions

View file

@ -34,6 +34,7 @@ import {ComposePrompt} from '../composer/Prompt'
import {List, ListMethods} from '../util/List'
import {ViewHeader} from '../util/ViewHeader'
import {PostThreadItem} from './PostThreadItem'
import {PostThreadLoadMore} from './PostThreadLoadMore'
import {PostThreadShowHiddenReplies} from './PostThreadShowHiddenReplies'
// FlatList maintainVisibleContentPosition breaks if too many items
@ -364,6 +365,9 @@ export function PostThread({
</View>
)
} else if (isThreadPost(item)) {
if (!treeView && item.ctx.hasMoreSelfThread) {
return <PostThreadLoadMore post={item.post} />
}
const prev = isThreadPost(posts[index - 1])
? (posts[index - 1] as ThreadPost)
: undefined