Reset state if comment submit fails

This commit is contained in:
Ben Brooks
2015-11-07 13:26:17 -05:00
parent 47aac4be24
commit 7e60ed05d7
5 changed files with 5 additions and 0 deletions

View File

@@ -688,6 +688,7 @@ var CommentBox = React.createClass({
this.setState({data: data});
}.bind(this),
error: function(xhr, status, err) {
this.setState({data: comments});
console.error(this.props.url, status, err.toString());
}.bind(this)
});