diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-20 09:20:53 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-20 09:20:53 -0600 |
commit | 99a28c0aae8349007f0ca1a01cb95343da08b2e8 (patch) | |
tree | 1ecf131631baa12be5e80377134890e79b930094 /src/state/models/feed-view.ts | |
parent | 71e4b3d756d992591a57829349179f725146ff15 (diff) | |
download | voidsky-99a28c0aae8349007f0ca1a01cb95343da08b2e8.tar.zst |
Proper fix to the previous panic fix: put threads at the end when they should be there
Diffstat (limited to 'src/state/models/feed-view.ts')
-rw-r--r-- | src/state/models/feed-view.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index 7be9e4494..3c4e68e2d 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 } |