diff options
author | =Corey Hulen <corey@hulen.com> | 2016-03-10 09:56:43 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-03-10 09:56:43 -0800 |
commit | 3ee2d218130e01d8df729495e0d121615271e98b (patch) | |
tree | 2ab1ee3db4b2927d5d65ebe8d8b4fdbf3ff1a2a3 /web | |
parent | 12434f8963b7e93836e2fa44ae1ce8806cea63cb (diff) | |
download | chat-3ee2d218130e01d8df729495e0d121615271e98b.tar.gz chat-3ee2d218130e01d8df729495e0d121615271e98b.tar.bz2 chat-3ee2d218130e01d8df729495e0d121615271e98b.zip |
Fixing blue bar on iOS
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/textbox.jsx | 2 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index c8c0c071e..d4eb60676 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -61,7 +61,7 @@ export default class Textbox extends React.Component { onRecievedError() { const errorCount = ErrorStore.getConnectionErrorCount(); - if (errorCount > 0) { + if (errorCount > 1) { this.setState({connection: 'bad-connection'}); } else { this.setState({connection: ''}); 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; }; |