Add a sanity check to avoid bad references, close #77
parent
1090783f91
commit
e08a46f0c6
|
@ -609,7 +609,10 @@ function preprocessFeed(feed: FeedViewPost[]): FeedViewPostWithThreadMeta[] {
|
||||||
for (const slice of threadSlices) {
|
for (const slice of threadSlices) {
|
||||||
if (slice.length > 3) {
|
if (slice.length > 3) {
|
||||||
reorg.splice(slice.index - removedCount + 1, slice.length - 3)
|
reorg.splice(slice.index - removedCount + 1, slice.length - 3)
|
||||||
|
if (reorg[slice.index - removedCount]) {
|
||||||
|
// ^ sanity check
|
||||||
reorg[slice.index - removedCount]._isThreadChildElided = true
|
reorg[slice.index - removedCount]._isThreadChildElided = true
|
||||||
|
}
|
||||||
removedCount += slice.length - 3
|
removedCount += slice.length - 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue