diff --git a/packages/frontend-2/components/viewer/anchored-point/thread/NewReply.vue b/packages/frontend-2/components/viewer/anchored-point/thread/NewReply.vue index 91e7bc1df2..232226a975 100644 --- a/packages/frontend-2/components/viewer/anchored-point/thread/NewReply.vue +++ b/packages/frontend-2/components/viewer/anchored-point/thread/NewReply.vue @@ -75,23 +75,26 @@ const onSubmit = async () => { if (!isValidCommentContentInput(content)) return loading.value = true - await createReply({ - content, - threadId: threadId.value, - projectId: projectId.value - }) - updateIsTyping(false) + try { + await createReply({ + content, + threadId: threadId.value, + projectId: projectId.value + }) + updateIsTyping(false) - // Mark all attachments as in use to prevent cleanup - commentValue.value.attachments?.forEach((a) => { - a.inUse = true - }) + // Mark all attachments as in use to prevent cleanup + commentValue.value.attachments?.forEach((a) => { + a.inUse = true + }) - commentValue.value = { - doc: undefined, - attachments: undefined + commentValue.value = { + doc: undefined, + attachments: undefined + } + emit('submit') + } finally { + loading.value = false } - loading.value = false - emit('submit') }