uberf-9385: fix select workspace redirects (#7942)
Some checks are pending
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2025-02-06 04:34:00 +04:00 committed by GitHub
parent 1dd22f85c5
commit 7df63cfd57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -48,12 +48,14 @@
let workspaces: WorkspaceInfoWithStatus[] = []
let status = OK
let accountPromise: Promise<LoginInfo | null>
let account: LoginInfo | null | undefined = undefined
let flagToUpdateWorkspaces = false
async function loadAccount (): Promise<void> {
account = await getAccount()
accountPromise = getAccount()
account = await accountPromise
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -101,6 +103,7 @@
try {
const res = await getWorkspaces()
await accountPromise
if (res.length === 0 && account?.token == null) {
goTo('confirmationSend')
}

View File

@ -64,9 +64,10 @@
const leaveWorkspace = await getResource(login.function.LeaveWorkspace)
const loginInfo = await leaveWorkspace(getCurrentAccount().uuid)
if (loginInfo?.token != null) {
const loc = getCurrentLocation()
clearMetadata(loc.path[1])
if (loginInfo?.token != null) {
setMetadata(presentation.metadata.Token, loginInfo.token)
setMetadataLocalStorage(login.metadata.LastToken, loginInfo.token)
setMetadataLocalStorage(login.metadata.LoginAccount, loginInfo.account)