Browse Source

Fix ID duplication in timelines (#7251)

pull/4/head
Akihiko Odaki 6 years ago
committed by Eugen Rochko
parent
commit
306267dbd2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/javascript/mastodon/reducers/timelines.js

+ 1
- 1
app/javascript/mastodon/reducers/timelines.js View File

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

Loading…
Cancel
Save