]> cat aescling's git repositories - mastodon.git/commitdiff
Fix timelines loading bug
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 12 Dec 2016 13:39:18 +0000 (14:39 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 12 Dec 2016 13:39:18 +0000 (14:39 +0100)
app/assets/javascripts/components/actions/timelines.jsx
app/assets/javascripts/components/features/account/components/action_bar.jsx
app/assets/javascripts/components/reducers/timelines.jsx

index 5aab993c130058e31ad1a8d8c086854c838159b1..0e6f09190d24e904cc5f629ae4c75784a8fbc3ff 100644 (file)
@@ -67,7 +67,7 @@ export function refreshTimeline(timeline, id = null) {
     let params = '';
     let path   = timeline;
 
-    if (newestId !== null) {
+    if (newestId !== null && getState().getIn(['timelines', timeline, 'loaded'])) {
       params = `?since_id=${newestId}`;
     }
 
index f09dea6abfa9fcef12e0efa79c1fb6214de69089..45de75d972deb74f807e7f173063af771b94eb7e 100644 (file)
@@ -39,7 +39,7 @@ const ActionBar = React.createClass({
   propTypes: {
     account: ImmutablePropTypes.map.isRequired,
     me: React.PropTypes.number.isRequired,
-    onFollow: React.PropTypes.func.isRequired,
+    onFollow: React.PropTypes.func,
     onBlock: React.PropTypes.func.isRequired,
     onMention: React.PropTypes.func.isRequired
   },
index de157eb25cc49b7750cc6a640c825a41124abf05..b73c83e0fbd55a1ee1ce51e00c5fd8d5b9d9e983 100644 (file)
@@ -83,7 +83,7 @@ const normalizeTimeline = (state, timeline, statuses, replace = false) => {
 
   state = state.setIn([timeline, 'loaded'], true);
 
-  return state.updateIn([timeline, 'items'], Immutable.List(), list => (loaded ? list.unshift(...ids) : list.push(...ids)));
+  return state.updateIn([timeline, 'items'], Immutable.List(), list => (loaded ? list.unshift(...ids) : ids));
 };
 
 const appendNormalizedTimeline = (state, timeline, statuses) => {