From dd6746c3d7ad458bb48b1694f56601e1d477ba9d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 8 Jul 2021 15:16:31 -0500 Subject: [PATCH] Timelines: determine status order in expandNormalizedTimeline --- app/soapbox/reducers/timelines.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/soapbox/reducers/timelines.js b/app/soapbox/reducers/timelines.js index 4aa44bf5f..444940ba1 100644 --- a/app/soapbox/reducers/timelines.js +++ b/app/soapbox/reducers/timelines.js @@ -43,7 +43,7 @@ const getStatusIds = (statuses = ImmutableList()) => ( ); const mergeStatusIds = (oldIds = ImmutableOrderedSet(), newIds = ImmutableOrderedSet()) => ( - newIds.first() > oldIds.first() ? newIds.union(oldIds) : oldIds.union(newIds) + newIds.union(oldIds) ); const addStatusId = (oldIds = ImmutableOrderedSet(), newId) => ( @@ -75,7 +75,13 @@ const expandNormalizedTimeline = (state, timelineId, statuses, next, isPartial, } if (!newIds.isEmpty()) { - timeline.update('items', ImmutableOrderedSet(), oldIds => mergeStatusIds(oldIds, newIds)); + timeline.update('items', ImmutableOrderedSet(), oldIds => { + if (newIds.first() > oldIds.first()) { + return mergeStatusIds(oldIds, newIds); + } else { + return mergeStatusIds(newIds, oldIds); + } + }); } })); };