Skip to content

Commit

Permalink
fix: prevented multiple api call while updating comment (#6352)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathalav55 authored Jan 10, 2025
1 parent 2018114 commit 7b3f206
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export const IssueCommentCard: FC<TIssueCommentCard> = observer((props) => {
defaultValues: { comment_html: comment?.comment_html },
});

const onEnter = (formData: Partial<TIssueComment>) => {
const onEnter = async (formData: Partial<TIssueComment>) => {
if (isSubmitting || !comment) return;
setIsEditing(false);

activityOperations.updateComment(comment.id, formData);
await activityOperations.updateComment(comment.id, formData);

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

0 comments on commit 7b3f206

Please sign in to comment.