Merge pull request #2414 from mattermost/bluebar-fix

Fixing blue bar on iOS
Этот коммит содержится в:
Christopher Speller
2016-03-11 08:50:27 -05:00
родитель 8b6b02143d 3ee2d21813
Коммит 19f28e896d
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@@ -61,7 +61,7 @@ export default class Textbox extends React.Component {
onRecievedError() { onRecievedError() {
const errorCount = ErrorStore.getConnectionErrorCount(); const errorCount = ErrorStore.getConnectionErrorCount();
if (errorCount > 0) { if (errorCount > 1) {
this.setState({connection: 'bad-connection'}); this.setState({connection: 'bad-connection'});
} else { } else {
this.setState({connection: ''}); this.setState({connection: ''});

Просмотреть файл

@@ -31,6 +31,7 @@ class SocketStoreClass extends EventEmitter {
this.close = this.close.bind(this); this.close = this.close.bind(this);
this.failCount = 0; this.failCount = 0;
this.isInitialize = false;
this.translations = this.getDefaultTranslations(); this.translations = this.getDefaultTranslations();
@@ -58,24 +59,23 @@ class SocketStoreClass extends EventEmitter {
if (this.failCount === 0) { if (this.failCount === 0) {
console.log('websocket connecting to ' + connUrl); //eslint-disable-line no-console 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 = new WebSocket(connUrl);
conn.onopen = () => { conn.onopen = () => {
if (this.failCount > 0) { if (this.failCount > 0) {
console.log('websocket re-established connection'); //eslint-disable-line no-console console.log('websocket re-established connection'); //eslint-disable-line no-console
ErrorStore.clearLastError();
ErrorStore.emitChange();
AsyncClient.getChannels(); AsyncClient.getChannels();
AsyncClient.getPosts(ChannelStore.getCurrentId()); AsyncClient.getPosts(ChannelStore.getCurrentId());
} }
if (this.isInitialize) {
ErrorStore.clearLastError();
ErrorStore.emitChange();
}
this.isInitialize = true;
this.failCount = 0; this.failCount = 0;
}; };