diff --git a/app/javascript/gabsocial/features/home_timeline.js b/app/javascript/gabsocial/features/home_timeline.js index ad970818..9ae7d84a 100644 --- a/app/javascript/gabsocial/features/home_timeline.js +++ b/app/javascript/gabsocial/features/home_timeline.js @@ -13,12 +13,10 @@ import StatusList from '../components/status_list' class HomeTimeline extends React.PureComponent { componentDidMount () { - this._checkIfReloadNeeded(false, this.props.isPartial) + this.props.onExpandHomeTimeline() } componentDidUpdate (prevProps) { - this._checkIfReloadNeeded(prevProps.isPartial, this.props.isPartial) - //Check if clicked on "home" button, if so, reload if (prevProps.location.key !== this.props.location.key && prevProps.location.pathname === '/home' && @@ -27,10 +25,6 @@ class HomeTimeline extends React.PureComponent { } } - componentWillUnmount () { - this._stopPolling() - } - handleLoadMore = (maxId) => { this.props.onExpandHomeTimeline({ maxId }) } @@ -39,25 +33,6 @@ class HomeTimeline extends React.PureComponent { this.props.onExpandHomeTimeline() }, 5000) - _checkIfReloadNeeded (wasPartial, isPartial) { - const { onExpandHomeTimeline } = this.props - - if (!wasPartial && isPartial) { - this.polling = setInterval(() => { - onExpandHomeTimeline() - }, 3000) - } else if (wasPartial && !isPartial) { - this._stopPolling() - } - } - - _stopPolling () { - if (this.polling) { - clearInterval(this.polling) - this.polling = null - } - } - render () { const { intl } = this.props