From 99a28c0aae8349007f0ca1a01cb95343da08b2e8 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 20 Dec 2022 09:20:53 -0600 Subject: [PATCH] Proper fix to the previous panic fix: put threads at the end when they should be there --- src/state/models/feed-view.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index 7be9e449..3c4e68e2 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -610,7 +610,9 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] { let newIndex = reorg.findIndex( item => new Date(item.indexedAt) < targetDate, ) - if (newIndex === -1) newIndex = 0 + if (newIndex === -1) { + newIndex = reorg.length + } reorg.splice(newIndex, 0, ...removed) slice.index = newIndex }