|
|
@ -19,6 +19,7 @@ const messages = defineMessages({ |
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({ |
|
|
|
const mapStateToProps = state => ({ |
|
|
|
hasUnread: state.getIn(['timelines', 'community', 'unread']) > 0, |
|
|
|
hasUnread: state.getIn(['timelines', 'community', 'unread']) > 0, |
|
|
|
|
|
|
|
streamingAPIBaseURL: state.getIn(['meta', 'streaming_api_base_url']), |
|
|
|
accessToken: state.getIn(['meta', 'access_token']) |
|
|
|
accessToken: state.getIn(['meta', 'access_token']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -29,6 +30,7 @@ const CommunityTimeline = React.createClass({ |
|
|
|
propTypes: { |
|
|
|
propTypes: { |
|
|
|
dispatch: React.PropTypes.func.isRequired, |
|
|
|
dispatch: React.PropTypes.func.isRequired, |
|
|
|
intl: React.PropTypes.object.isRequired, |
|
|
|
intl: React.PropTypes.object.isRequired, |
|
|
|
|
|
|
|
streamingAPIBaseURL: React.PropTypes.string.isRequired, |
|
|
|
accessToken: React.PropTypes.string.isRequired, |
|
|
|
accessToken: React.PropTypes.string.isRequired, |
|
|
|
hasUnread: React.PropTypes.bool |
|
|
|
hasUnread: React.PropTypes.bool |
|
|
|
}, |
|
|
|
}, |
|
|
@ -36,7 +38,7 @@ const CommunityTimeline = React.createClass({ |
|
|
|
mixins: [PureRenderMixin], |
|
|
|
mixins: [PureRenderMixin], |
|
|
|
|
|
|
|
|
|
|
|
componentDidMount () { |
|
|
|
componentDidMount () { |
|
|
|
const { dispatch, accessToken } = this.props; |
|
|
|
const { dispatch, streamingAPIBaseURL, accessToken } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
dispatch(refreshTimeline('community')); |
|
|
|
dispatch(refreshTimeline('community')); |
|
|
|
|
|
|
|
|
|
|
@ -44,7 +46,7 @@ const CommunityTimeline = React.createClass({ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
subscription = createStream(accessToken, 'public:local', { |
|
|
|
subscription = createStream(streamingAPIBaseURL, accessToken, 'public:local', { |
|
|
|
|
|
|
|
|
|
|
|
connected () { |
|
|
|
connected () { |
|
|
|
dispatch(connectTimeline('community')); |
|
|
|
dispatch(connectTimeline('community')); |
|
|
|