|
|
|
@ -344,12 +344,14 @@ class TopicDetail extends Component {
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.data.data.id) {
|
|
|
|
|
let newId = response.data.data.id;
|
|
|
|
|
const commentIndex = this._findById(id, comments);
|
|
|
|
|
let mycontent = response.data.data.content;
|
|
|
|
|
|
|
|
|
|
const commentIndex = this._findById(id, comments);
|
|
|
|
|
const parentComment = comments[commentIndex]
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
// runTesting: false,
|
|
|
|
|
comments: addSecondLevelComment(comments, parentComment, commentIndex, newId, commentContent, user, editor)
|
|
|
|
|
comments: addSecondLevelComment(comments, parentComment, commentIndex, newId, mycontent, user, editor)
|
|
|
|
|
}, ()=>{
|
|
|
|
|
// keditor代码美化
|
|
|
|
|
editor.html && window.prettyPrint()
|
|
|
|
@ -409,6 +411,7 @@ class TopicDetail extends Component {
|
|
|
|
|
|
|
|
|
|
if (response.data) {
|
|
|
|
|
const _id = response.data.data.id;
|
|
|
|
|
let mycontent=response.data.data.content;
|
|
|
|
|
// ke
|
|
|
|
|
editor.html && editor.html('');
|
|
|
|
|
editor.afterBlur && editor.afterBlur()
|
|
|
|
@ -418,7 +421,7 @@ class TopicDetail extends Component {
|
|
|
|
|
|
|
|
|
|
const user = this._getUser();
|
|
|
|
|
this.setState({
|
|
|
|
|
comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
|
|
|
|
|
comments: addNewComment(comments, _id, mycontent, user, this.props.isSuperAdmin(), this)
|
|
|
|
|
})
|
|
|
|
|
const newMemo2 = Object.assign({}, this.state.memo);
|
|
|
|
|
newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
|
|
|
|
|