mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-21 17:17:54 +02:00
UBER-438: Use tracker as default for new users/workspaces (#3403)
This commit is contained in:
@@ -273,11 +273,38 @@
|
||||
let space = loc.path[3] as Ref<Space>
|
||||
let special = loc.path[4]
|
||||
const fragment = loc.fragment
|
||||
|
||||
let navigateDone = false
|
||||
if (app === undefined) {
|
||||
const last = localStorage.getItem(`platform_last_loc_${loc.path[1]}`)
|
||||
if (last != null) {
|
||||
navigate(JSON.parse(last))
|
||||
const lastValue = JSON.parse(last)
|
||||
navigateDone = navigate(lastValue)
|
||||
if (navigateDone) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (app === undefined && !navigateDone) {
|
||||
const appShort = getMetadata(workbench.metadata.DefaultApplication) as Ref<Application>
|
||||
const spaceRef = getMetadata(workbench.metadata.DefaultSpace) as Ref<Space>
|
||||
const specialRef = getMetadata(workbench.metadata.DefaultSpecial) as Ref<Space>
|
||||
const loc = getCurrentLocation()
|
||||
// Be sure URI is not yet changed
|
||||
if (loc.path[2] === undefined) {
|
||||
loc.path[2] = appShort
|
||||
let len = 3
|
||||
if (spaceRef !== undefined && specialRef !== undefined) {
|
||||
const spaceObj = await client.findOne(core.class.Space, { _id: spaceRef })
|
||||
if (spaceObj !== undefined) {
|
||||
loc.path[3] = spaceRef
|
||||
loc.path[4] = specialRef
|
||||
len = 5
|
||||
}
|
||||
}
|
||||
loc.path.length = len
|
||||
if (navigate(loc)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user