summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-26 09:49:29 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-26 09:49:29 -0800
commita0cc464c973fe0b2ca8aa1fa386656435bdbfbec (patch)
tree77646ea56732d30d87e975b9ccccae273f6a1915 /web/react/components
parentce5ea641aafa269aad44d1d3dd31db30e8fc2b04 (diff)
downloadchat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.tar.gz
chat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.tar.bz2
chat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.zip
PLT-2030 fixing error handling
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/error_bar.jsx16
-rw-r--r--web/react/components/textbox.jsx4
2 files changed, 2 insertions, 18 deletions
diff --git a/web/react/components/error_bar.jsx b/web/react/components/error_bar.jsx
index f04185b46..9a114c544 100644
--- a/web/react/components/error_bar.jsx
+++ b/web/react/components/error_bar.jsx
@@ -38,25 +38,9 @@ export default class ErrorBar extends React.Component {
return false;
}
- if (s.connErrorCount && s.connErrorCount >= 1 && s.connErrorCount < 7) {
- return false;
- }
-
return true;
}
- isConnectionError(s) {
- if (!s.connErrorCount || s.connErrorCount === 0) {
- return false;
- }
-
- if (s.connErrorCount > 7) {
- return true;
- }
-
- return false;
- }
-
componentWillMount() {
if (global.window.mm_config.SendEmailNotifications === 'false') {
ErrorStore.storeLastError({message: this.props.intl.formatMessage(messages.preview)});
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index ec299087d..23ecfb57b 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -59,9 +59,9 @@ export default class Textbox extends React.Component {
}
onRecievedError() {
- const errorState = ErrorStore.getLastError();
+ const errorCount = ErrorStore.getConnectionErrorCount();
- if (errorState && errorState.connErrorCount > 0) {
+ if (errorCount > 0) {
this.setState({connection: 'bad-connection'});
} else {
this.setState({connection: ''});