18315: Fixes websocket init.
[arvados-workbench2.git] / src / index.tsx
index 0b04c29e4c896c5387688caeadb35cc29bafc43a..c160f96c2c9346be412757a149c5d45c7da78ec7 100644 (file)
@@ -183,7 +183,7 @@ const initListener = (history: History, store: RootStore, services: ServiceRepos
     let initialized = false;
     return async () => {
         const { router, auth } = store.getState();
-        if (router.location && auth.user && !initialized) {
+        if (router.location && auth.user && services.authService.getApiToken() && !initialized) {
             initialized = true;
             initWebSocket(config, services.authService, store);
             await store.dispatch(loadWorkbench());