mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Fix inbox reading (#3390)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
316b8d810c
commit
5eaaa3f8a6
@ -49,6 +49,7 @@
|
|||||||
let _id: Ref<Doc> | undefined
|
let _id: Ref<Doc> | undefined
|
||||||
let _class: Ref<Class<Doc>> | undefined
|
let _class: Ref<Class<Doc>> | undefined
|
||||||
let selectedEmployee: Ref<EmployeeAccount> | undefined = undefined
|
let selectedEmployee: Ref<EmployeeAccount> | undefined = undefined
|
||||||
|
const prevValue: DocUpdates | undefined = undefined
|
||||||
|
|
||||||
async function select (value: DocUpdates | undefined) {
|
async function select (value: DocUpdates | undefined) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@ -57,17 +58,15 @@
|
|||||||
_class = undefined
|
_class = undefined
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (prevValue !== undefined) {
|
||||||
|
await client.update(prevValue, { txes: prevValue.txes })
|
||||||
|
}
|
||||||
const targetClass = hierarchy.getClass(value.attachedToClass)
|
const targetClass = hierarchy.getClass(value.attachedToClass)
|
||||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||||
component = panelComponent.component ?? view.component.EditDoc
|
component = panelComponent.component ?? view.component.EditDoc
|
||||||
_id = value.attachedTo
|
_id = value.attachedTo
|
||||||
_class = value.attachedToClass
|
_class = value.attachedToClass
|
||||||
await read(value)
|
value.txes.forEach((p) => (p.isNew = false))
|
||||||
}
|
|
||||||
|
|
||||||
async function read (docUpdate: DocUpdates): Promise<void> {
|
|
||||||
docUpdate.txes.forEach((p) => (p.isNew = false))
|
|
||||||
await client.update(docUpdate, { txes: docUpdate.txes })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDM (value: Ref<Doc>) {
|
function openDM (value: Ref<Doc>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user