From 240d7c82ccdcda6bfe26e5f853851281e5585da1 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/docs/tutorial.it-IT.md | 1 + docs/docs/tutorial.ja-JP.md | 1 + docs/docs/tutorial.ko-KR.md | 1 + docs/docs/tutorial.md | 1 + docs/docs/tutorial.zh-CN.md | 1 + 5 files changed, 5 insertions(+) diff --git a/docs/docs/tutorial.it-IT.md b/docs/docs/tutorial.it-IT.md index 4a165bca8f..9180656d62 100644 --- a/docs/docs/tutorial.it-IT.md +++ b/docs/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/docs/tutorial.ja-JP.md b/docs/docs/tutorial.ja-JP.md index 3eaeb221ee..a8cc5ef246 100644 --- a/docs/docs/tutorial.ja-JP.md +++ b/docs/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/docs/tutorial.ko-KR.md b/docs/docs/tutorial.ko-KR.md index 83c1b00598..5bd64af408 100644 --- a/docs/docs/tutorial.ko-KR.md +++ b/docs/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/docs/tutorial.md b/docs/docs/tutorial.md index 83bab0dd6d..cded19081f 100644 --- a/docs/docs/tutorial.md +++ b/docs/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/docs/tutorial.zh-CN.md b/docs/docs/tutorial.zh-CN.md index b09d84adf0..7ffdd7be26 100644 --- a/docs/docs/tutorial.zh-CN.md +++ b/docs/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) });