itizawa 6 лет назад
Родитель
Сommit
365e6efde3

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

@@ -291,6 +291,7 @@ class Comment extends React.Component {
             commentBody={comment.comment}
             replyTo={undefined}
             commentButtonClickedHandler={this.commentButtonClickedHandler}
+            commentCreator={creator.username}
           />
         ) : (
           <div className={rootClassName}>

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

@@ -115,6 +115,7 @@ class CommentEditor extends React.Component {
           this.state.comment,
           this.state.isMarkdown,
           this.props.currentCommentId,
+          this.props.commentCreator,
         );
       }
       else {
@@ -335,6 +336,7 @@ CommentEditor.propTypes = {
   replyTo: PropTypes.string,
   currentCommentId: PropTypes.string,
   commentBody: PropTypes.string,
+  commentCreator: PropTypes.string,
   commentButtonClickedHandler: PropTypes.func.isRequired,
 };
 

+ 2 - 2
src/client/js/services/CommentContainer.js

@@ -103,7 +103,7 @@ export default class CommentContainer extends Container {
   /**
    * Load data of comments and rerender <PageComments />
    */
-  putComment(comment, isMarkdown, commentId) {
+  putComment(comment, isMarkdown, commentId, creator) {
     const { pageId, revisionId } = this.getPageContainer().state;
 
     return this.appContainer.apiPost('/comments.update', {
@@ -113,7 +113,7 @@ export default class CommentContainer extends Container {
         revision_id: revisionId,
         is_markdown: isMarkdown,
         comment_id: commentId,
-        author: this.appContainer.me,
+        author: creator,
       },
     })
       .then((res) => {