Network status listens to some global events

Listen for reconnectTimer to display reconnection info. Listen for
unauthorized to update network status immediately after a failed login,
rather than waiting for the normal 5s interval to time out.

// FREEBIE
This commit is contained in:
lilia 2017-04-12 14:11:51 -07:00
parent d3492960a6
commit df65585e71
2 changed files with 7 additions and 3 deletions

View file

@ -221,6 +221,7 @@
if (e.name === 'HTTPError' && (e.code == 401 || e.code == 403)) {
Whisper.Registration.remove();
Whisper.events.trigger('unauthorized');
extension.install();
return;
}
@ -231,9 +232,7 @@
console.log('retrying in 1 minute');
setTimeout(init, 60000);
if (owsDesktopApp.inboxView) {
owsDesktopApp.inboxView.networkStatusView.setSocketReconnectInterval(60000);
}
Whisper.events.trigger('reconnectTimer');
} else {
console.log('offline');
messageReceiver.close();