Fix to thread ordering in the feed: correctly identify the starts of threads when adjacent
parent
ae3099dfca
commit
e99eb7bfad
|
@ -601,10 +601,14 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] {
|
||||||
} else {
|
} else {
|
||||||
if (!item._isThreadChild) {
|
if (!item._isThreadChild) {
|
||||||
threadSlices.push({index: activeSlice, length: i - activeSlice})
|
threadSlices.push({index: activeSlice, length: i - activeSlice})
|
||||||
|
if (item._isThreadParent) {
|
||||||
|
activeSlice = i
|
||||||
|
} else {
|
||||||
activeSlice = -1
|
activeSlice = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (activeSlice !== -1) {
|
if (activeSlice !== -1) {
|
||||||
threadSlices.push({index: activeSlice, length: reorg.length - activeSlice})
|
threadSlices.push({index: activeSlice, length: reorg.length - activeSlice})
|
||||||
}
|
}
|
||||||
|
@ -630,7 +634,6 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] {
|
||||||
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)
|
||||||
reorg[slice.index - removedCount]._isThreadChildElided = true
|
reorg[slice.index - removedCount]._isThreadChildElided = true
|
||||||
console.log(reorg[slice.index - removedCount])
|
|
||||||
removedCount += slice.length - 3
|
removedCount += slice.length - 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue