From 9239a7353af2c67a6778ff4cabd164db62087bde Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Wed, 23 Mar 2016 10:20:52 -0400
Subject: Fixing websocket connection issue. Refactoring websockets into an
 action creator.

---
 webapp/root.jsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'webapp/root.jsx')

diff --git a/webapp/root.jsx b/webapp/root.jsx
index b0a6ae1ac..b3041ad59 100644
--- a/webapp/root.jsx
+++ b/webapp/root.jsx
@@ -24,11 +24,11 @@ import Sidebar from 'components/sidebar.jsx';
 import * as AsyncClient from 'utils/async_client.jsx';
 import PreferenceStore from 'stores/preference_store.jsx';
 import ChannelStore from 'stores/channel_store.jsx';
-import SocketStore from 'stores/socket_store.jsx';
 import ErrorStore from 'stores/error_store.jsx';
 import BrowserStore from 'stores/browser_store.jsx';
 import SignupTeam from 'components/signup_team.jsx';
 import * as Client from 'utils/client.jsx';
+import * as Websockets from 'action_creators/websocket_actions.jsx';
 import * as GlobalActions from 'action_creators/global_actions.jsx';
 import SignupTeamConfirm from 'components/signup_team_confirm.jsx';
 import SignupUserComplete from 'components/signup_user_complete.jsx';
@@ -101,11 +101,10 @@ function preRenderSetup(callwhendone) {
         // Do Nothing
     };
 
+    // Make sure the websockets close
     $(window).on('beforeunload',
          () => {
-             if (window.SocketStore) {
-                 SocketStore.close();
-             }
+             Websockets.close();
          }
     );
 
-- 
cgit v1.2.3-1-g7c22

