From 7b3f206f570a448c758c8d9338da1ff11b9da3c9 Mon Sep 17 00:00:00 2001 From: Vamsi Krishna <46787868+mathalav55@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:20:13 +0530 Subject: [PATCH] fix: prevented multiple api call while updating comment (#6352) --- .../issue-detail/issue-activity/comments/comment-card.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx b/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx index 79eac92a6be..baae682881a 100644 --- a/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx +++ b/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx @@ -67,11 +67,11 @@ export const IssueCommentCard: FC = observer((props) => { defaultValues: { comment_html: comment?.comment_html }, }); - const onEnter = (formData: Partial) => { + const onEnter = async (formData: Partial) => { if (isSubmitting || !comment) return; setIsEditing(false); - activityOperations.updateComment(comment.id, formData); + await activityOperations.updateComment(comment.id, formData); editorRef.current?.setEditorValue(formData?.comment_html ?? "

"); showEditorRef.current?.setEditorValue(formData?.comment_html ?? "

");