From 6bf6beb2d2e55393190e0849eba6b2f3cd763c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Tue, 10 Nov 2015 14:42:28 -0800 Subject: [PATCH] Merge pull request #5416 from bbrooks/undo-optimistic-update-on-error Reset state if comment submit fails (cherry picked from commit eecd2953cd4abb22dff48743d448e87f49484916) --- 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) });