From 89417c7f844b90c574946d8486f1b37f8b9519bb Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Wed, 17 Jul 2024 11:29:09 +0500 Subject: [PATCH] fix props for panel (#6081) Signed-off-by: Vyacheslav Tumanov --- .../src/components/Workbench.svelte | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index 8824aedd66..458ff68f6d 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -21,7 +21,14 @@ import notification, { DocNotifyContext, InboxNotification, notificationId } from '@hcengineering/notification' import { BrowserNotificatator, InboxNotificationsClientImpl } from '@hcengineering/notification-resources' import { IntlString, broadcastEvent, getMetadata, getResource } from '@hcengineering/platform' - import { ActionContext, ComponentExtensions, getClient, isAdminUser, reduceCalls } from '@hcengineering/presentation' + import { + ActionContext, + ComponentExtensions, + createQuery, + getClient, + isAdminUser, + reduceCalls + } from '@hcengineering/presentation' import setting from '@hcengineering/setting' import support, { SupportStatus, supportLink } from '@hcengineering/support' import { @@ -406,6 +413,7 @@ const _class = props[2] as Ref> const _id = await parseLinkId(linkProviders, props[1], _class) const doc = await client.findOne(_class, { _id }) + panelDoc = { _class, _id } if (doc !== undefined) { const provider = ListSelectionProvider.Find(doc._id) @@ -428,6 +436,17 @@ closePanel(false) } } + let panelDoc: undefined | { _id: Ref, _class: Ref> } = undefined + const panelQuery = createQuery() + + $: if (panelDoc !== undefined) { + panelQuery.query(panelDoc._class, { _id: panelDoc._id }, (r) => { + if (r.length === 0) { + closePanel(false) + panelDoc = undefined + } + }) + } function clear (level: number): void { switch (level) {