parent
6ad5863573
commit
2754121f67
|
@ -168,14 +168,25 @@ export class FeedTuner {
|
||||||
|
|
||||||
const selfReplyUri = getSelfReplyUri(item)
|
const selfReplyUri = getSelfReplyUri(item)
|
||||||
if (selfReplyUri) {
|
if (selfReplyUri) {
|
||||||
const parent = slices.find(item2 =>
|
const index = slices.findIndex(slice =>
|
||||||
item2.isNextInThread(selfReplyUri),
|
slice.isNextInThread(selfReplyUri),
|
||||||
)
|
)
|
||||||
if (parent) {
|
|
||||||
|
if (index !== -1) {
|
||||||
|
const parent = slices[index]
|
||||||
|
|
||||||
parent.insert(item)
|
parent.insert(item)
|
||||||
|
|
||||||
|
// If our slice isn't currently on the top, reinsert it to the top.
|
||||||
|
if (index !== 0) {
|
||||||
|
slices.splice(index, 1)
|
||||||
|
slices.unshift(parent)
|
||||||
|
}
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slices.unshift(new FeedViewPostsSlice([item]))
|
slices.unshift(new FeedViewPostsSlice([item]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue