From b174d2cdf5fbc3c2ea42a1f6157c82c724d4c977 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 15 Feb 2022 18:55:33 -0300 Subject: [PATCH] 18315: Fixes websocket init. When accessing WB2 using the '/token?api_token=xxx' URL, the websocket service was being initialized with 'api_token=undefined'. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 0b04c29e..c160f96c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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()); -- 2.30.2