diff --git a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte index 430cefa3a4..1ccf9ba61b 100644 --- a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte +++ b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte @@ -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) { - 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 + }))