diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-09 18:23:14 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-09 18:23:14 -0700 |
commit | b4b0e92fd49c50d5e5125a1092d71fc5832b468b (patch) | |
tree | e3d1e815425e101feaef9ec301bfe353bca21010 /web | |
parent | 582c94cee97748b20af732cab6442c2a90a15100 (diff) | |
download | chat-b4b0e92fd49c50d5e5125a1092d71fc5832b468b.tar.gz chat-b4b0e92fd49c50d5e5125a1092d71fc5832b468b.tar.bz2 chat-b4b0e92fd49c50d5e5125a1092d71fc5832b468b.zip |
Moved check for existing timer interrupt outside of if-else block for sanity
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/textbox.jsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index 718ecbe4c..b5b696124 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -49,6 +49,11 @@ module.exports = React.createClass({ _onError: function() { 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") { this.setState({ connection: " bad-connection" }); var timerInterrupt = window.setInterval(this._onTimerInterrupt, 5000); @@ -56,10 +61,6 @@ module.exports = React.createClass({ } else { this.setState({ connection: "" }); - if (this.state.timerInterrupt != null) { - window.clearInterval(this.state.timerInterrupt); - this.setState({ timerInterrupt: null }); - } } }, _onTimerInterrupt: function() { |