]> cat aescling's git repositories - mastodon.git/commitdiff
Skip pagination logic for pinned account timelines in reducer (#7540)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 19 May 2018 00:51:29 +0000 (02:51 +0200)
committerGitHub <noreply@github.com>
Sat, 19 May 2018 00:51:29 +0000 (02:51 +0200)
Fix #7516

app/javascript/mastodon/reducers/timelines.js

index b09d78b0fbae1371459beb1a0785888caed6e63d..916a091eb9bc69075de2402ce0a99e1ce810e4aa 100644 (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);