fix current space in navigator

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-09 22:34:02 +02:00
parent 0e81bdeebc
commit 8418270f29
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -19,7 +19,7 @@
import type { Asset } from '@anticrm/platform'
import type { Ref, Space } from '@anticrm/core'
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 { getClient, createQuery } from '@anticrm/presentation'
@ -48,12 +48,15 @@
}
function selectSpace(id: Ref<Space>) {
selected = id
const loc = getCurrentLocation()
loc.path[2] = id
loc.path.length = 3
navigate(loc)
}
onDestroy(location.subscribe(async (loc) => {
selected = loc.path[2] as Ref<Space>
}))
</script>
<div>