mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Fix inbox dot (#3407)
This commit is contained in:
parent
b9d134b7cf
commit
489351946f
@ -68,6 +68,7 @@
|
||||
changeSelected(selected)
|
||||
} else {
|
||||
selected = index
|
||||
markAsRead(selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,11 +77,20 @@
|
||||
|
||||
$: changeSelected(selected)
|
||||
|
||||
function markAsRead (index: number) {
|
||||
if (filtered[index] !== undefined) {
|
||||
filtered[index].txes.forEach((p) => (p.isNew = false))
|
||||
filtered[index].txes = filtered[index].txes
|
||||
filtered = filtered
|
||||
}
|
||||
}
|
||||
|
||||
function changeSelected (index: number) {
|
||||
if (filtered[index] !== undefined) {
|
||||
listProvider.updateFocus(filtered[index])
|
||||
_id = filtered[index]?.attachedTo
|
||||
dispatch('change', filtered[index])
|
||||
markAsRead(index)
|
||||
} else if (filtered.length) {
|
||||
if (index < filtered.length - 1) {
|
||||
selected++
|
||||
|
@ -64,6 +64,7 @@
|
||||
changeSelected(selected)
|
||||
} else {
|
||||
selected = index
|
||||
markAsRead(selected)
|
||||
}
|
||||
}
|
||||
loading = false
|
||||
@ -77,11 +78,20 @@
|
||||
|
||||
$: changeSelected(selected)
|
||||
|
||||
function markAsRead (index: number) {
|
||||
if (docs[index] !== undefined) {
|
||||
docs[index].txes.forEach((p) => (p.isNew = false))
|
||||
docs[index].txes = docs[index].txes
|
||||
docs = docs
|
||||
}
|
||||
}
|
||||
|
||||
function changeSelected (index: number) {
|
||||
if (docs[index] !== undefined) {
|
||||
listProvider.updateFocus(docs[index])
|
||||
_id = docs[index]?.attachedTo
|
||||
dispatch('change', docs[index])
|
||||
markAsRead(index)
|
||||
} else if (docs.length) {
|
||||
if (index < docs.length - 1) {
|
||||
selected++
|
||||
|
@ -49,7 +49,7 @@
|
||||
let _id: Ref<Doc> | undefined
|
||||
let _class: Ref<Class<Doc>> | undefined
|
||||
let selectedEmployee: Ref<EmployeeAccount> | undefined = undefined
|
||||
const prevValue: DocUpdates | undefined = undefined
|
||||
let prevValue: DocUpdates | undefined = undefined
|
||||
|
||||
async function select (value: DocUpdates | undefined) {
|
||||
if (!value) {
|
||||
@ -59,14 +59,16 @@
|
||||
return
|
||||
}
|
||||
if (prevValue !== undefined) {
|
||||
await client.update(prevValue, { txes: prevValue.txes })
|
||||
prevValue.txes.forEach((p) => (p.isNew = false))
|
||||
const txes = prevValue.txes
|
||||
await client.update(prevValue, { txes })
|
||||
}
|
||||
const targetClass = hierarchy.getClass(value.attachedToClass)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
component = panelComponent.component ?? view.component.EditDoc
|
||||
_id = value.attachedTo
|
||||
_class = value.attachedToClass
|
||||
value.txes.forEach((p) => (p.isNew = false))
|
||||
prevValue = value
|
||||
}
|
||||
|
||||
function openDM (value: Ref<Doc>) {
|
||||
|
Loading…
Reference in New Issue
Block a user