Timelines: determine status order in expandNormalizedTimeline

actually-fix-tabs-bar
Alex Gleason 2021-07-08 15:16:31 -05:00
rodzic 1a3a6e2eb5
commit dd6746c3d7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -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);
}
});
}
}));
};