From 7e60ed05d70085fedc6c49c209f54807eb64c8b9 Mon Sep 17 00:00:00 2001 From: Ben Brooks Date: Sat, 7 Nov 2015 13:26:17 -0500 Subject: [PATCH] Reset state if comment submit fails --- docs/tutorial.it-IT.md | 1 + docs/tutorial.ja-JP.md | 1 + docs/tutorial.ko-KR.md | 1 + docs/tutorial.md | 1 + docs/tutorial.zh-CN.md | 1 + 5 files changed, 5 insertions(+) diff --git a/docs/tutorial.it-IT.md b/docs/tutorial.it-IT.md index 4a165bca..9180656d 100644 --- a/docs/tutorial.it-IT.md +++ b/docs/tutorial.it-IT.md @@ -686,6 +686,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) }); diff --git a/docs/tutorial.ja-JP.md b/docs/tutorial.ja-JP.md index 3eaeb221..a8cc5ef2 100644 --- a/docs/tutorial.ja-JP.md +++ b/docs/tutorial.ja-JP.md @@ -682,6 +682,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) }); diff --git a/docs/tutorial.ko-KR.md b/docs/tutorial.ko-KR.md index 83c1b005..5bd64af4 100644 --- a/docs/tutorial.ko-KR.md +++ b/docs/tutorial.ko-KR.md @@ -691,6 +691,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) }); diff --git a/docs/tutorial.md b/docs/tutorial.md index 83bab0dd..cded1908 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -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) }); diff --git a/docs/tutorial.zh-CN.md b/docs/tutorial.zh-CN.md index b09d84ad..7ffdd7be 100644 --- a/docs/tutorial.zh-CN.md +++ b/docs/tutorial.zh-CN.md @@ -686,6 +686,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) });