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)

---
 app/assets/javascripts/components/stream.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'app/assets/javascripts/components/stream.jsx')

diff --git a/app/assets/javascripts/components/stream.jsx b/app/assets/javascripts/components/stream.jsx
index 392268b23..08da71607 100644
--- a/app/assets/javascripts/components/stream.jsx
+++ b/app/assets/javascripts/components/stream.jsx
@@ -10,8 +10,8 @@ const createWebSocketURL = (url) => {
   return a.href;
 };
 
-export default function getStream(accessToken, stream, { connected, received, disconnected, reconnected }) {
-  const ws = new WebSocketClient(`${createWebSocketURL(STREAMING_API_BASE_URL)}/api/v1/streaming/?access_token=${accessToken}&stream=${stream}`);
+export default function getStream(streamingAPIBaseURL, accessToken, stream, { connected, received, disconnected, reconnected }) {
+  const ws = new WebSocketClient(`${createWebSocketURL(streamingAPIBaseURL)}/api/v1/streaming/?access_token=${accessToken}&stream=${stream}`);
 
   ws.onopen      = connected;
   ws.onmessage   = e => received(JSON.parse(e.data));
-- 
cgit 

