Yuki Takei 2 лет назад
Родитель
Сommit
024e153062
1 измененных файлов с 2 добавлено и 7 удалено
  1. 2 7
      apps/app/src/components/PageComment/CommentEditor.tsx

+ 2 - 7
apps/app/src/components/PageComment/CommentEditor.tsx

@@ -150,9 +150,7 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
   }, [onCancelButtonClicked, initializeEditor]);
 
   const postCommentHandler = useCallback(async() => {
-    const commentBodyToPost = codeMirrorEditor?.getDoc();
-
-    if (commentBodyToPost == null || commentBodyToPost?.length === 0) return;
+    const commentBodyToPost = codeMirrorEditor?.getDoc() ?? '';
 
     try {
       if (currentCommentId != null) {
@@ -233,20 +231,17 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
     </button>
   ), [cancelButtonClickedHandler, t]);
   const submitButton = useMemo(() => {
-    const commentBodyToPost = codeMirrorEditor?.getDoc() ?? '';
-
     return (
       <button
         type="button"
         data-testid="comment-submit-button"
         className="btn btn-primary"
         onClick={postCommentHandler}
-        disabled={commentBodyToPost.length === 0}
       >
         {t('page_comment.comment')}
       </button>
     );
-  }, [codeMirrorEditor, postCommentHandler, t]);
+  }, [postCommentHandler, t]);
 
   return (
     <CommentEditorLayout>