Skip pagination logic for pinned account timelines in reducer (#7540)

Fix #7516
main
Eugen Rochko 2018-05-19 02:51:29 +02:00 committed by GitHub
parent 0b1f88cfd5
commit 7871d29aff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,11 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial) =>
if (!statuses.isEmpty()) {
mMap.update('items', ImmutableList(), oldIds => {
const newIds = statuses.map(status => status.get('id'));
if (timeline.indexOf(':pinned') !== -1) {
return newIds;
}
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);