Skip to content
Snippets Groups Projects
Commit 15bef77a authored by Thibaut Girka's avatar Thibaut Girka Committed by ThibG
Browse files

[Glitch] Fix ID duplication in timelines

Port 306267db to glitch-soc
parent 4b38ac3b
Branches
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial) =>
mMap.update('items', ImmutableList(), oldIds => {
const newIds = statuses.map(status => status.get('id'));
const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1;
const firstIndex = oldIds.take(lastIndex).findLastIndex(id => id !== null && compareId(id, newIds.first()) >= 0);
const firstIndex = oldIds.take(lastIndex).findLastIndex(id => id !== null && compareId(id, newIds.first()) > 0);
if (firstIndex < 0) {
return (isPartial ? newIds.unshift(null) : newIds).concat(oldIds.skip(lastIndex));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment