fix: prevented multiple api call while updating comment (#6352)

This commit is contained in:
Vamsi Krishna 2025-01-10 10:20:13 +05:30 committed by GitHub
parent 2018114543
commit 7b3f206f57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,11 +67,11 @@ export const IssueCommentCard: FC<TIssueCommentCard> = observer((props) => {
defaultValues: { comment_html: comment?.comment_html }, defaultValues: { comment_html: comment?.comment_html },
}); });
const onEnter = (formData: Partial<TIssueComment>) => { const onEnter = async (formData: Partial<TIssueComment>) => {
if (isSubmitting || !comment) return; if (isSubmitting || !comment) return;
setIsEditing(false); setIsEditing(false);
activityOperations.updateComment(comment.id, formData); await activityOperations.updateComment(comment.id, formData);
editorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>"); editorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>");
showEditorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>"); showEditorRef.current?.setEditorValue(formData?.comment_html ?? "<p></p>");