Moved check for existing timer interrupt outside of if-else block for sanity
Этот коммит содержится в:
@@ -49,6 +49,11 @@ module.exports = React.createClass({
|
|||||||
_onError: function() {
|
_onError: function() {
|
||||||
var errorState = getStateFromStores();
|
var errorState = getStateFromStores();
|
||||||
|
|
||||||
|
if (this.state.timerInterrupt != null) {
|
||||||
|
window.clearInterval(this.state.timerInterrupt);
|
||||||
|
this.setState({ timerInterrupt: null });
|
||||||
|
}
|
||||||
|
|
||||||
if (errorState.message === "There appears to be a problem with your internet connection") {
|
if (errorState.message === "There appears to be a problem with your internet connection") {
|
||||||
this.setState({ connection: " bad-connection" });
|
this.setState({ connection: " bad-connection" });
|
||||||
var timerInterrupt = window.setInterval(this._onTimerInterrupt, 5000);
|
var timerInterrupt = window.setInterval(this._onTimerInterrupt, 5000);
|
||||||
@@ -56,10 +61,6 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.setState({ connection: "" });
|
this.setState({ connection: "" });
|
||||||
if (this.state.timerInterrupt != null) {
|
|
||||||
window.clearInterval(this.state.timerInterrupt);
|
|
||||||
this.setState({ timerInterrupt: null });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_onTimerInterrupt: function() {
|
_onTimerInterrupt: function() {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user