From 53237b463052c85af64795081deb8b4451b63ab7 Mon Sep 17 00:00:00 2001 From: andrewwallacespeckle <139135120+andrewwallacespeckle@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:46:57 +0000 Subject: [PATCH] Update NewReply.vue (#3718) --- .../viewer/anchored-point/thread/NewReply.vue | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) 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') }