mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-23 21:02:24 +02:00
TSK-112: Fix workbench switch (#2074)
Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
@@ -129,9 +129,9 @@
|
||||
)
|
||||
|
||||
async function syncLoc (loc: Location): Promise<void> {
|
||||
const app = loc.path.length > 0 ? (loc.path[1] as Ref<Application>) : undefined
|
||||
let space = loc.path.length > 1 ? (loc.path[2] as Ref<Space>) : undefined
|
||||
let special = loc.path.length > 2 ? loc.path[3] : undefined
|
||||
const app = loc.path.length > 1 ? (loc.path[1] as Ref<Application>) : undefined
|
||||
let space = loc.path.length > 2 ? (loc.path[2] as Ref<Space>) : undefined
|
||||
let special = loc.path.length > 3 ? loc.path[3] : undefined
|
||||
|
||||
if (currentApp !== app) {
|
||||
clear(1)
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
|
||||
if (space === undefined) {
|
||||
const last = localStorage.getItem(`platform_last_loc_${currentApp}`)
|
||||
const last = localStorage.getItem(`platform_last_loc_${app}`)
|
||||
if (last !== null) {
|
||||
const newLocation: Location = JSON.parse(last)
|
||||
loc.path[2] = space = newLocation.path[2] as Ref<Space>
|
||||
@@ -161,7 +161,7 @@
|
||||
}
|
||||
}
|
||||
if (app !== undefined) {
|
||||
localStorage.setItem(`platform_last_loc_${currentApp}`, JSON.stringify(loc))
|
||||
localStorage.setItem(`platform_last_loc_${app}`, JSON.stringify(loc))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user