diff options
author | Joachim Viide <jviide@iki.fi> | 2017-04-15 03:32:42 +0300 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-15 02:32:42 +0200 |
commit | ef879a88393598f5dd83a2ced6dfadbebe888203 (patch) | |
tree | e3d9ae4815e0b520a0152313633ba2da5ed1dbef /app/assets/javascripts/components/features/public_timeline/index.jsx | |
parent | 9240ca6cefdec25574f329b70438c4fa4571a1e4 (diff) |
Send initial state in a <script type="application/json"> tag (#1806)
Diffstat (limited to 'app/assets/javascripts/components/features/public_timeline/index.jsx')
-rw-r--r-- | app/assets/javascripts/components/features/public_timeline/index.jsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/features/public_timeline/index.jsx b/app/assets/javascripts/components/features/public_timeline/index.jsx index a7ac95ab4..d5fa168f5 100644 --- a/app/assets/javascripts/components/features/public_timeline/index.jsx +++ b/app/assets/javascripts/components/features/public_timeline/index.jsx @@ -19,6 +19,7 @@ const messages = defineMessages({ const mapStateToProps = state => ({ hasUnread: state.getIn(['timelines', 'public', 'unread']) > 0, + streamingAPIBaseURL: state.getIn(['meta', 'streaming_api_base_url']), accessToken: state.getIn(['meta', 'access_token']) }); @@ -29,6 +30,7 @@ const PublicTimeline = React.createClass({ propTypes: { dispatch: React.PropTypes.func.isRequired, intl: React.PropTypes.object.isRequired, + streamingAPIBaseURL: React.PropTypes.string.isRequired, accessToken: React.PropTypes.string.isRequired, hasUnread: React.PropTypes.bool }, @@ -36,7 +38,7 @@ const PublicTimeline = React.createClass({ mixins: [PureRenderMixin], componentDidMount () { - const { dispatch, accessToken } = this.props; + const { dispatch, streamingAPIBaseURL, accessToken } = this.props; dispatch(refreshTimeline('public')); @@ -44,7 +46,7 @@ const PublicTimeline = React.createClass({ return; } - subscription = createStream(accessToken, 'public', { + subscription = createStream(streamingAPIBaseURL, accessToken, 'public', { connected () { dispatch(connectTimeline('public')); |