From 908fcf83c6a2df34769f04c98fbe0edf31f6959f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 12 Dec 2016 14:39:18 +0100 Subject: [PATCH] Fix timelines loading bug --- app/assets/javascripts/components/actions/timelines.jsx | 2 +- .../components/features/account/components/action_bar.jsx | 2 +- app/assets/javascripts/components/reducers/timelines.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/components/actions/timelines.jsx b/app/assets/javascripts/components/actions/timelines.jsx index 5aab993c1..0e6f09190 100644 --- a/app/assets/javascripts/components/actions/timelines.jsx +++ b/app/assets/javascripts/components/actions/timelines.jsx @@ -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}`; } diff --git a/app/assets/javascripts/components/features/account/components/action_bar.jsx b/app/assets/javascripts/components/features/account/components/action_bar.jsx index f09dea6ab..45de75d97 100644 --- a/app/assets/javascripts/components/features/account/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/account/components/action_bar.jsx @@ -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 }, diff --git a/app/assets/javascripts/components/reducers/timelines.jsx b/app/assets/javascripts/components/reducers/timelines.jsx index de157eb25..b73c83e0f 100644 --- a/app/assets/javascripts/components/reducers/timelines.jsx +++ b/app/assets/javascripts/components/reducers/timelines.jsx @@ -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) => {