itizawa 6 лет назад
Родитель
Сommit
2528523c84

+ 1 - 0
src/client/js/components/PageComment/Comment.jsx

@@ -262,6 +262,7 @@ class Comment extends React.Component {
           <CommentEditor
             growiRenderer={this.growiRenderer}
             currentComment={comment}
+            commentBody={comment.comment}
             reEdit
             replyTo={undefined}
             commentButtonClickedHandler={this.commentButtonClickedHandler}

+ 2 - 1
src/client/js/components/PageComment/CommentEditor.jsx

@@ -36,7 +36,7 @@ class CommentEditor extends React.Component {
     const isUploadableFile = config.upload.file;
 
     this.state = {
-      comment: '',
+      comment: this.props.commentBody || '',
       isMarkdown: true,
       html: '',
       key: 1,
@@ -330,6 +330,7 @@ CommentEditor.propTypes = {
   replyTo: PropTypes.string,
   reEdit: PropTypes.bool,
   currentComment: PropTypes.object,
+  commentBody: PropTypes.string,
   commentButtonClickedHandler: PropTypes.func.isRequired,
 };