Skip to content

Commit 7b3f206

Browse files
fix: prevented multiple api call while updating comment (#6352)
1 parent 2018114 commit 7b3f206

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ export const IssueCommentCard: FC<TIssueCommentCard> = observer((props) => {
6767
defaultValues: { comment_html: comment?.comment_html },
6868
});
6969

70-
const onEnter = (formData: Partial<TIssueComment>) => {
70+
const onEnter = async (formData: Partial<TIssueComment>) => {
7171
if (isSubmitting || !comment) return;
7272
setIsEditing(false);
7373

74-
activityOperations.updateComment(comment.id, formData);
74+
await activityOperations.updateComment(comment.id, formData);
7575

7676
editorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>");
7777
showEditorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>");

0 commit comments

Comments
 (0)