Browse Source

conditional branch for togglr editor

itizawa 6 years ago
parent
commit
2d2d135e55
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/client/js/components/PageComment/CommentEditor.jsx

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

@@ -84,7 +84,14 @@ class CommentEditor extends React.Component {
   }
   }
 
 
   toggleEditor() {
   toggleEditor() {
-    this.props.commentButtonClickedHandler(this.props.replyTo);
+    let targetId;
+    if (this.props.reEdit) {
+      targetId = this.props.currentComment._id;
+    }
+    else {
+      targetId = this.props.replyTo;
+    }
+    this.props.commentButtonClickedHandler(targetId);
   }
   }
 
 
   /**
   /**