Browse Source

conditional branch for togglr editor

itizawa 6 năm trước cách đây
mục cha
commit
2d2d135e55
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  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() {
-    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);
   }
 
   /**