diff options
Diffstat (limited to 'app/assets/javascripts/components/containers')
-rw-r--r-- | app/assets/javascripts/components/containers/mastodon.jsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index f1038bbe7..a771d1269 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -61,8 +61,8 @@ import { hydrateStore } from '../actions/store'; import createStream from '../stream'; const store = configureStore(); - -store.dispatch(hydrateStore(window.INITIAL_STATE)); +const initialState = JSON.parse(document.getElementById("initial-state").textContent); +store.dispatch(hydrateStore(initialState)); const browserHistory = useRouterHistory(createBrowserHistory)({ basename: '/web' @@ -95,9 +95,10 @@ const Mastodon = React.createClass({ componentDidMount() { const { locale } = this.props; + const streamingAPIBaseURL = store.getState().getIn(['meta', 'streaming_api_base_url']); const accessToken = store.getState().getIn(['meta', 'access_token']); - this.subscription = createStream(accessToken, 'user', { + this.subscription = createStream(streamingAPIBaseURL, accessToken, 'user', { connected () { store.dispatch(connectTimeline('home')); |