mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
fix props for panel (#6081)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
2b3caf6283
commit
89417c7f84
@ -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<Class<Doc>>
|
||||
const _id = await parseLinkId(linkProviders, props[1], _class)
|
||||
const doc = await client.findOne<Doc>(_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<Doc>, _class: Ref<Class<Doc>> } = 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user