summaryrefslogtreecommitdiffstats
path: root/web/react/stores/socket_store.jsx
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/stores/socket_store.jsx
parentce5ea641aafa269aad44d1d3dd31db30e8fc2b04 (diff)
downloadchat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.tar.gz
chat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.tar.bz2
chat-a0cc464c973fe0b2ca8aa1fa386656435bdbfbec.zip
PLT-2030 fixing error handling
Diffstat (limited to 'web/react/stores/socket_store.jsx')
-rw-r--r--web/react/stores/socket_store.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index efb57e226..46f322e5f 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -66,7 +66,7 @@ class SocketStoreClass extends EventEmitter {
console.log('websocket re-established connection'); //eslint-disable-line no-console
if (ErrorStore.getLastError()) {
- ErrorStore.storeLastError(null);
+ ErrorStore.clearLastError();
ErrorStore.emitChange();
}
@@ -86,7 +86,11 @@ class SocketStoreClass extends EventEmitter {
this.failCount = this.failCount + 1;
- ErrorStore.storeLastError({connErrorCount: this.failCount, message: this.translations.socketError});
+ if (this.failCount > 7) {
+ ErrorStore.storeLastError({message: this.translations.socketError});
+ }
+
+ ErrorStore.setConnectionErrorCount(this.failCount);
ErrorStore.emitChange();
setTimeout(