From ef879a88393598f5dd83a2ced6dfadbebe888203 Mon Sep 17 00:00:00 2001
From: Joachim Viide <jviide@iki.fi>
Date: Sat, 15 Apr 2017 03:32:42 +0300
Subject: Send initial state in a <script type="application/json"> tag (#1806)

---
 .../javascripts/components/features/community_timeline/index.jsx    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'app/assets/javascripts/components/features/community_timeline/index.jsx')

diff --git a/app/assets/javascripts/components/features/community_timeline/index.jsx b/app/assets/javascripts/components/features/community_timeline/index.jsx
index acfc30b65..f7bc94d99 100644
--- a/app/assets/javascripts/components/features/community_timeline/index.jsx
+++ b/app/assets/javascripts/components/features/community_timeline/index.jsx
@@ -19,6 +19,7 @@ const messages = defineMessages({
 
 const mapStateToProps = state => ({
   hasUnread: state.getIn(['timelines', 'community', 'unread']) > 0,
+  streamingAPIBaseURL: state.getIn(['meta', 'streaming_api_base_url']),
   accessToken: state.getIn(['meta', 'access_token'])
 });
 
@@ -29,6 +30,7 @@ const CommunityTimeline = 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 CommunityTimeline = React.createClass({
   mixins: [PureRenderMixin],
 
   componentDidMount () {
-    const { dispatch, accessToken } = this.props;
+    const { dispatch, streamingAPIBaseURL, accessToken } = this.props;
 
     dispatch(refreshTimeline('community'));
 
@@ -44,7 +46,7 @@ const CommunityTimeline = React.createClass({
       return;
     }
 
-    subscription = createStream(accessToken, 'public:local', {
+    subscription = createStream(streamingAPIBaseURL, accessToken, 'public:local', {
 
       connected () {
         dispatch(connectTimeline('community'));
-- 
cgit 

