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