diff --git a/packages/text-editor/src/components/ReferenceInput.svelte b/packages/text-editor/src/components/ReferenceInput.svelte
index 7bd451eb83..c277897130 100644
--- a/packages/text-editor/src/components/ReferenceInput.svelte
+++ b/packages/text-editor/src/components/ReferenceInput.svelte
@@ -15,7 +15,7 @@
@@ -140,4 +147,5 @@
{shouldSaveDraft}
on:message={onMessage}
on:update={onUpdate}
+ {loading}
/>
diff --git a/plugins/chunter-resources/src/components/activity/TxCommentCreate.svelte b/plugins/chunter-resources/src/components/activity/TxCommentCreate.svelte
index a1f37cfd0b..a54eaa151a 100644
--- a/plugins/chunter-resources/src/components/activity/TxCommentCreate.svelte
+++ b/plugins/chunter-resources/src/components/activity/TxCommentCreate.svelte
@@ -33,30 +33,36 @@
const editing = false
async function onMessage (event: CustomEvent>) {
- const { message, attachments } = event.detail
- await client.updateCollection(
- tx.objectClass,
- tx.objectSpace,
- tx.objectId,
- value.attachedTo,
- value.attachedToClass,
- value.collection,
- {
- message,
- attachments
- }
- )
- // We need to update backlinks before and after.
- await updateBacklinks(client, value.attachedTo, value.attachedToClass, value._id, message)
-
+ loading = true
+ try {
+ const { message, attachments } = event.detail
+ await client.updateCollection(
+ tx.objectClass,
+ tx.objectSpace,
+ tx.objectId,
+ value.attachedTo,
+ value.attachedToClass,
+ value.collection,
+ {
+ message,
+ attachments
+ }
+ )
+ // We need to update backlinks before and after.
+ await updateBacklinks(client, value.attachedTo, value.attachedToClass, value._id, message)
+ } finally {
+ loading = false
+ }
dispatch('close', false)
}
let refInput: AttachmentRefInput
+ let loading = false