From 8418270f291cb585e7c85829a48829bd8baae838 Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Thu, 9 Sep 2021 22:34:02 +0200 Subject: [PATCH] fix current space in navigator Signed-off-by: Andrey Platov --- .../src/components/navigator/SpacesNav.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 + }))