소스 검색

conditional branch for togglr editor

itizawa 6 년 전
부모
커밋
2d2d135e55
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  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);
   }
 
   /**