From: Lucas Di Pentima Date: Tue, 15 Feb 2022 21:55:33 +0000 (-0300) Subject: 18315: Fixes websocket init. X-Git-Tag: 2.4.0~10^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/b174d2cdf5fbc3c2ea42a1f6157c82c724d4c977 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 --- 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());