mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-24 20:40:59 +00:00
Fix select workspace when open workspace in new tab (#5545)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
b27b88bc04
commit
2c3ffba681
@ -310,7 +310,7 @@ export async function selectWorkspace (workspace: string): Promise<[Status, Work
|
||||
}
|
||||
}
|
||||
|
||||
const token = getMetadata(presentation.metadata.Token)
|
||||
const token = getMetadata(presentation.metadata.Token) ?? fetchMetadataLocalStorage(login.metadata.LastToken)
|
||||
if (token === undefined) {
|
||||
const loc = getCurrentLocation()
|
||||
loc.path[0] = 'login'
|
||||
|
@ -67,7 +67,11 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
const tokens: Record<string, string> = fetchMetadataLocalStorage(login.metadata.LoginTokens) ?? {}
|
||||
let token = tokens[ws]
|
||||
|
||||
if (token === undefined && getMetadata(presentation.metadata.Token) !== undefined) {
|
||||
if (
|
||||
token === undefined &&
|
||||
(getMetadata(presentation.metadata.Token) !== undefined ||
|
||||
fetchMetadataLocalStorage(login.metadata.LastToken) != null)
|
||||
) {
|
||||
const selectWorkspace = await getResource(login.function.SelectWorkspace)
|
||||
const loginInfo = await ctx.with('select-workspace', {}, async () => (await selectWorkspace(ws))[1])
|
||||
if (loginInfo !== undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user