mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
fix current space in navigator
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
0e81bdeebc
commit
8418270f29
@ -19,7 +19,7 @@
|
|||||||
import type { Asset } from '@anticrm/platform'
|
import type { Asset } from '@anticrm/platform'
|
||||||
import type { Ref, Space } from '@anticrm/core'
|
import type { Ref, Space } from '@anticrm/core'
|
||||||
import type { SpacesNavModel } from '@anticrm/workbench'
|
import type { SpacesNavModel } from '@anticrm/workbench'
|
||||||
import { Action, navigate, getCurrentLocation } from '@anticrm/ui'
|
import { Action, navigate, getCurrentLocation, location } from '@anticrm/ui'
|
||||||
|
|
||||||
import { IconAdd } from '@anticrm/ui'
|
import { IconAdd } from '@anticrm/ui'
|
||||||
import { getClient, createQuery } from '@anticrm/presentation'
|
import { getClient, createQuery } from '@anticrm/presentation'
|
||||||
@ -48,12 +48,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectSpace(id: Ref<Space>) {
|
function selectSpace(id: Ref<Space>) {
|
||||||
selected = id
|
|
||||||
const loc = getCurrentLocation()
|
const loc = getCurrentLocation()
|
||||||
loc.path[2] = id
|
loc.path[2] = id
|
||||||
loc.path.length = 3
|
loc.path.length = 3
|
||||||
navigate(loc)
|
navigate(loc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDestroy(location.subscribe(async (loc) => {
|
||||||
|
selected = loc.path[2] as Ref<Space>
|
||||||
|
}))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user