mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-06 15:57:05 +00:00
Fix draft comment stuck (#3072)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
b259173407
commit
1ce134c292
@ -79,25 +79,30 @@
|
|||||||
async function onMessage (event: CustomEvent) {
|
async function onMessage (event: CustomEvent) {
|
||||||
loading = true
|
loading = true
|
||||||
const { message, attachments } = event.detail
|
const { message, attachments } = event.detail
|
||||||
await client.addCollection<Doc, Comment>(
|
try {
|
||||||
_class,
|
draftController.remove()
|
||||||
object.space,
|
commentInputBox.removeDraft(false)
|
||||||
object._id,
|
await client.addCollection<Doc, Comment>(
|
||||||
object._class,
|
_class,
|
||||||
'comments',
|
object.space,
|
||||||
{ message, attachments },
|
object._id,
|
||||||
_id
|
object._class,
|
||||||
)
|
'comments',
|
||||||
|
{ message, attachments },
|
||||||
|
_id
|
||||||
|
)
|
||||||
|
|
||||||
// Create an backlink to document
|
// Create an backlink to document
|
||||||
await createBacklinks(client, object._id, object._class, _id, message)
|
await createBacklinks(client, object._id, object._class, _id, message)
|
||||||
|
|
||||||
// Remove draft from Local Storage
|
// Remove draft from Local Storage
|
||||||
_id = generateId()
|
_id = generateId()
|
||||||
comment = getDefault()
|
comment = getDefault()
|
||||||
draftController.remove()
|
} catch (err) {
|
||||||
commentInputBox.removeDraft(false)
|
console.error(err)
|
||||||
loading = false
|
} finally {
|
||||||
|
loading = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user