about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/timelines.js
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-05-31 22:30:26 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-31 15:30:26 +0200
commite49dc6a06eb18af023da82d60e485cd3c382fc96 (patch)
treeb272b1ab4a9e11b829dbcc0774b6f91508d9b777 /app/javascript/mastodon/reducers/timelines.js
parent0e12a8dab9ccec83b91722a8b0a065c0919af98a (diff)
Fix load more on account timelines (regression from #3311) (#3475)
This prevents `next` state from being overridden on the loading *new* statuses.
Diffstat (limited to 'app/javascript/mastodon/reducers/timelines.js')
-rw-r--r--app/javascript/mastodon/reducers/timelines.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/reducers/timelines.js b/app/javascript/mastodon/reducers/timelines.js
index 0087a06ce..ab756b854 100644
--- a/app/javascript/mastodon/reducers/timelines.js
+++ b/app/javascript/mastodon/reducers/timelines.js
@@ -138,7 +138,7 @@ const normalizeAccountTimeline = (state, accountId, statuses, replace, next) =>
   return state.updateIn(['accounts_timelines', accountId], Immutable.Map(), map => map
     .set('isLoading', false)
     .set('loaded', true)
-    .set('next', next)
+    .update('next', null, v => replace ? next : v)
     .update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
 };
 
@@ -152,7 +152,7 @@ const normalizeAccountMediaTimeline = (state, accountId, statuses, replace, next
 
   return state.updateIn(['accounts_media_timelines', accountId], Immutable.Map(), map => map
     .set('isLoading', false)
-    .set('next', next)
+    .update('next', null, v => replace ? next : v)
     .update('items', Immutable.List(), list => (replace ? ids : ids.concat(list))));
 };