Fix: don't incorrectly assemble threads when somebody replies multiple times to the same post

zio/stable
Paul Frazee 2023-03-21 13:13:36 -05:00
parent 858d4c8c88
commit 92d9267805
1 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,10 @@ export class FeedViewPostsSlice {
return !!this.items.find(item => item.post.uri === uri)
}
isNextInThread(uri: string) {
return this.items[this.items.length - 1].post.uri === uri
}
insert(item: FeedViewPost) {
const selfReplyUri = getSelfReplyUri(item)
const i = this.items.findIndex(item2 => item2.post.uri === selfReplyUri)
@ -102,7 +106,7 @@ export class FeedTuner {
const selfReplyUri = getSelfReplyUri(item)
if (selfReplyUri) {
const parent = slices.find(item2 => item2.containsUri(selfReplyUri))
const parent = slices.find(item2 => item2.isNextInThread(selfReplyUri))
if (parent) {
parent.insert(item)
continue