From a8aaf5bd743645796603d91d4e45b85b1c18dd26 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 19 Jul 2024 20:04:21 +0500 Subject: [PATCH] Fix infinity fetch workspace (#6106) Signed-off-by: Denis Bykhov --- plugins/workbench-resources/src/connect.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/workbench-resources/src/connect.ts b/plugins/workbench-resources/src/connect.ts index 6d4d953d59..391567ab1c 100644 --- a/plugins/workbench-resources/src/connect.ts +++ b/plugins/workbench-resources/src/connect.ts @@ -88,6 +88,13 @@ export async function connect (title: string): Promise { if (ws !== getCurrentLocation().path[1]) return workspaceCreating.set(loginInfo?.createProgress ?? 0) loginInfo = await ctx.with('fetch-workspace', {}, async () => (await fetchWorkspace(ws))[1]) + if (loginInfo === undefined) { + // something went wrong, workspace not exist, redirect to login + navigate({ + path: [loginId] + }) + return + } workspaceCreating.set(loginInfo?.createProgress) if (loginInfo?.creating === false) { workspaceCreating.set(-1)