Fix infinity fetch workspace (#6106)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-07-19 20:04:21 +05:00 committed by GitHub
parent 5816a0dedd
commit a8aaf5bd74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,6 +88,13 @@ export async function connect (title: string): Promise<Client | undefined> {
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)