diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-19 21:37:04 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-19 21:37:04 +0100 |
commit | c50256d25c47110119ea3386050040c916f2cf83 (patch) | |
tree | 5ee106d7c2c03276a7a4b11e5322b0ae7a616dd0 /app/assets/javascripts/components/reducers/timelines.jsx | |
parent | 4aa5ebe59142eedbb1aa9dad88c608dda9ad8d6c (diff) |
Fix infinite scrolling breaking after navigation
Diffstat (limited to 'app/assets/javascripts/components/reducers/timelines.jsx')
-rw-r--r-- | app/assets/javascripts/components/reducers/timelines.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/reducers/timelines.jsx b/app/assets/javascripts/components/reducers/timelines.jsx index 1c71d822d..2dbced7ae 100644 --- a/app/assets/javascripts/components/reducers/timelines.jsx +++ b/app/assets/javascripts/components/reducers/timelines.jsx @@ -101,7 +101,10 @@ const normalizeTimeline = (state, timeline, statuses, next) => { state = state.setIn([timeline, 'loaded'], true); state = state.setIn([timeline, 'isLoading'], false); - state = state.setIn([timeline, 'next'], next); + + if (state.getIn([timeline, 'next']) === null) { + state = state.setIn([timeline, 'next'], next); + } return state.updateIn([timeline, 'items'], Immutable.List(), list => (loaded ? list.unshift(...ids) : ids)); }; @@ -237,6 +240,7 @@ const resetTimeline = (state, timeline, id) => { .set('id', id) .set('isLoading', true) .set('loaded', false) + .set('next', null) .update('items', list => list.clear())); } else { state = state.setIn([timeline, 'isLoading'], true); |