diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-11 08:50:27 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-11 08:50:27 -0500 |
commit | 19f28e896d6d564e9c395ec90597d42709b2e3b8 (patch) | |
tree | 4ec6784a1032609236bcb454db16d3221175a066 /web/react/stores/socket_store.jsx | |
parent | 8b6b02143d7b96e5fcd6031a8d9abb2c3051268d (diff) | |
parent | 3ee2d218130e01d8df729495e0d121615271e98b (diff) | |
download | chat-19f28e896d6d564e9c395ec90597d42709b2e3b8.tar.gz chat-19f28e896d6d564e9c395ec90597d42709b2e3b8.tar.bz2 chat-19f28e896d6d564e9c395ec90597d42709b2e3b8.zip |
Merge pull request #2414 from mattermost/bluebar-fix
Fixing blue bar on iOS
Diffstat (limited to 'web/react/stores/socket_store.jsx')
-rw-r--r-- | web/react/stores/socket_store.jsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index 9b2b049b7..ec25255d9 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -31,6 +31,7 @@ class SocketStoreClass extends EventEmitter { this.close = this.close.bind(this); this.failCount = 0; + this.isInitialize = false; this.translations = this.getDefaultTranslations(); @@ -58,24 +59,23 @@ class SocketStoreClass extends EventEmitter { if (this.failCount === 0) { console.log('websocket connecting to ' + connUrl); //eslint-disable-line no-console - if (ErrorStore.getConnectionErrorCount() > 0) { - ErrorStore.setConnectionErrorCount(0); - ErrorStore.emitChange(); - } } + conn = new WebSocket(connUrl); conn.onopen = () => { if (this.failCount > 0) { console.log('websocket re-established connection'); //eslint-disable-line no-console + AsyncClient.getChannels(); + AsyncClient.getPosts(ChannelStore.getCurrentId()); + } + if (this.isInitialize) { ErrorStore.clearLastError(); ErrorStore.emitChange(); - - AsyncClient.getChannels(); - AsyncClient.getPosts(ChannelStore.getCurrentId()); } + this.isInitialize = true; this.failCount = 0; }; |