[Glitch] Disable real-time updates on public pages to improve readability

Port 42c581c458 to glitch-soc
This commit is contained in:
Eugen Rochko 2019-03-18 18:34:56 +01:00 committed by Thibaut Girka
parent 1d6152f440
commit 2a93c88015
2 changed files with 0 additions and 22 deletions

View file

@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { expandHashtagTimeline } from 'flavours/glitch/actions/timelines'; import { expandHashtagTimeline } from 'flavours/glitch/actions/timelines';
import { connectHashtagStream } from 'flavours/glitch/actions/streaming';
import Masonry from 'react-masonry-infinite'; import Masonry from 'react-masonry-infinite';
import { List as ImmutableList } from 'immutable'; import { List as ImmutableList } from 'immutable';
import DetailedStatusContainer from 'flavours/glitch/features/status/containers/detailed_status_container'; import DetailedStatusContainer from 'flavours/glitch/features/status/containers/detailed_status_container';
@ -31,14 +30,6 @@ class HashtagTimeline extends React.PureComponent {
const { dispatch, hashtag } = this.props; const { dispatch, hashtag } = this.props;
dispatch(expandHashtagTimeline(hashtag)); dispatch(expandHashtagTimeline(hashtag));
this.disconnect = dispatch(connectHashtagStream(hashtag, hashtag));
}
componentWillUnmount () {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
}
} }
handleLoadMore = () => { handleLoadMore = () => {

View file

@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { expandPublicTimeline, expandCommunityTimeline } from 'flavours/glitch/actions/timelines'; import { expandPublicTimeline, expandCommunityTimeline } from 'flavours/glitch/actions/timelines';
import { connectPublicStream, connectCommunityStream } from 'flavours/glitch/actions/streaming';
import Masonry from 'react-masonry-infinite'; import Masonry from 'react-masonry-infinite';
import { List as ImmutableList, Map as ImmutableMap } from 'immutable'; import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
import DetailedStatusContainer from 'flavours/glitch/features/status/containers/detailed_status_container'; import DetailedStatusContainer from 'flavours/glitch/features/status/containers/detailed_status_container';
@ -42,22 +41,10 @@ class PublicTimeline extends React.PureComponent {
} }
} }
componentWillUnmount () {
this._disconnect();
}
_connect () { _connect () {
const { dispatch, local } = this.props; const { dispatch, local } = this.props;
dispatch(local ? expandCommunityTimeline() : expandPublicTimeline()); dispatch(local ? expandCommunityTimeline() : expandPublicTimeline());
this.disconnect = dispatch(local ? connectCommunityStream() : connectPublicStream());
}
_disconnect () {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
}
} }
handleLoadMore = () => { handleLoadMore = () => {