From a9d839245dc56b5b2c586afd28432fe03238d322 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Thu, 15 Dec 2022 11:44:59 +0600 Subject: [PATCH] Fix changed token (#2439) Signed-off-by: Denis Bykhov --- plugins/login-resources/src/utils.ts | 2 +- .../src/components/SelectWorkspaceMenu.svelte | 29 +++++-------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/plugins/login-resources/src/utils.ts b/plugins/login-resources/src/utils.ts index b4ce288d0a..7c32e569d2 100644 --- a/plugins/login-resources/src/utils.ts +++ b/plugins/login-resources/src/utils.ts @@ -277,7 +277,6 @@ export async function selectWorkspace (workspace: string): Promise<[Status, Work } export function setLoginInfo (loginInfo: WorkspaceLoginInfo): void { - setMetadata(login.metadata.LoginToken, loginInfo.token) const tokens: Record = fetchMetadataLocalStorage(login.metadata.LoginTokens) ?? {} tokens[loginInfo.workspace] = loginInfo.token @@ -290,6 +289,7 @@ export function navigateToWorkspace (workspace: string, loginInfo?: WorkspaceLog if (loginInfo == null) { return } + setMetadata(login.metadata.LoginToken, loginInfo.token) setLoginInfo(loginInfo) if (navigateUrl !== undefined) { diff --git a/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte b/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte index e24106ca10..cee1484f53 100644 --- a/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte +++ b/plugins/workbench-resources/src/components/SelectWorkspaceMenu.svelte @@ -14,33 +14,16 @@ --> - +{#if workspaces.length} + +{:else} + +{/if}