Fix to error condition that breaks the feed
parent
0401dfc5d3
commit
71e4b3d756
|
@ -607,9 +607,10 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] {
|
||||||
slice.length,
|
slice.length,
|
||||||
)
|
)
|
||||||
const targetDate = new Date(removed[removed.length - 1].indexedAt)
|
const targetDate = new Date(removed[removed.length - 1].indexedAt)
|
||||||
const newIndex = reorg.findIndex(
|
let newIndex = reorg.findIndex(
|
||||||
item => new Date(item.indexedAt) < targetDate,
|
item => new Date(item.indexedAt) < targetDate,
|
||||||
)
|
)
|
||||||
|
if (newIndex === -1) newIndex = 0
|
||||||
reorg.splice(newIndex, 0, ...removed)
|
reorg.splice(newIndex, 0, ...removed)
|
||||||
slice.index = newIndex
|
slice.index = newIndex
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue