|
|
|
@ -45,6 +45,7 @@ class PublicTimeline extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
static contextTypes = {
|
|
|
|
|
router: PropTypes.object,
|
|
|
|
|
identity: PropTypes.object,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
@ -80,20 +81,31 @@ class PublicTimeline extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
componentDidMount () {
|
|
|
|
|
const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props;
|
|
|
|
|
const { signedIn } = this.context.identity;
|
|
|
|
|
|
|
|
|
|
dispatch(expandPublicTimeline({ onlyMedia, onlyRemote, allowLocalOnly }));
|
|
|
|
|
if (signedIn) {
|
|
|
|
|
this.disconnect = dispatch(connectPublicStream({ onlyMedia, onlyRemote, allowLocalOnly }));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate (prevProps) {
|
|
|
|
|
const { signedIn } = this.context.identity;
|
|
|
|
|
|
|
|
|
|
if (prevProps.onlyMedia !== this.props.onlyMedia || prevProps.onlyRemote !== this.props.onlyRemote || prevProps.allowLocalOnly !== this.props.allowLocalOnly) {
|
|
|
|
|
const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props;
|
|
|
|
|
|
|
|
|
|
if (this.disconnect) {
|
|
|
|
|
this.disconnect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dispatch(expandPublicTimeline({ onlyMedia, onlyRemote, allowLocalOnly }));
|
|
|
|
|
|
|
|
|
|
if (signedIn) {
|
|
|
|
|
this.disconnect = dispatch(connectPublicStream({ onlyMedia, onlyRemote, allowLocalOnly }));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
|
|
if (this.disconnect) {
|
|
|
|
|