mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-03 05:43:24 +00:00
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
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:
parent
1dd22f85c5
commit
7df63cfd57
@ -48,12 +48,14 @@
|
|||||||
|
|
||||||
let workspaces: WorkspaceInfoWithStatus[] = []
|
let workspaces: WorkspaceInfoWithStatus[] = []
|
||||||
let status = OK
|
let status = OK
|
||||||
|
let accountPromise: Promise<LoginInfo | null>
|
||||||
let account: LoginInfo | null | undefined = undefined
|
let account: LoginInfo | null | undefined = undefined
|
||||||
|
|
||||||
let flagToUpdateWorkspaces = false
|
let flagToUpdateWorkspaces = false
|
||||||
|
|
||||||
async function loadAccount (): Promise<void> {
|
async function loadAccount (): Promise<void> {
|
||||||
account = await getAccount()
|
accountPromise = getAccount()
|
||||||
|
account = await accountPromise
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
@ -101,6 +103,7 @@
|
|||||||
try {
|
try {
|
||||||
const res = await getWorkspaces()
|
const res = await getWorkspaces()
|
||||||
|
|
||||||
|
await accountPromise
|
||||||
if (res.length === 0 && account?.token == null) {
|
if (res.length === 0 && account?.token == null) {
|
||||||
goTo('confirmationSend')
|
goTo('confirmationSend')
|
||||||
}
|
}
|
||||||
|
@ -64,9 +64,10 @@
|
|||||||
const leaveWorkspace = await getResource(login.function.LeaveWorkspace)
|
const leaveWorkspace = await getResource(login.function.LeaveWorkspace)
|
||||||
const loginInfo = await leaveWorkspace(getCurrentAccount().uuid)
|
const loginInfo = await leaveWorkspace(getCurrentAccount().uuid)
|
||||||
|
|
||||||
if (loginInfo?.token != null) {
|
|
||||||
const loc = getCurrentLocation()
|
const loc = getCurrentLocation()
|
||||||
clearMetadata(loc.path[1])
|
clearMetadata(loc.path[1])
|
||||||
|
|
||||||
|
if (loginInfo?.token != null) {
|
||||||
setMetadata(presentation.metadata.Token, loginInfo.token)
|
setMetadata(presentation.metadata.Token, loginInfo.token)
|
||||||
setMetadataLocalStorage(login.metadata.LastToken, loginInfo.token)
|
setMetadataLocalStorage(login.metadata.LastToken, loginInfo.token)
|
||||||
setMetadataLocalStorage(login.metadata.LoginAccount, loginInfo.account)
|
setMetadataLocalStorage(login.metadata.LoginAccount, loginInfo.account)
|
||||||
|
Loading…
Reference in New Issue
Block a user