Trigger empty event on keepalive timeout (#1466)

This commit is contained in:
Lilia
2017-09-13 20:25:51 +02:00
committed by Scott Nonnenberg
parent 420cfc46be
commit c832324cb9
2 changed files with 6 additions and 0 deletions

View File

@@ -57,6 +57,9 @@ MessageReceiver.prototype.extend({
if (ev.code === 3000) {
return;
}
if (ev.code === 3001) {
this.onEmpty();
}
// possible 403 or network issue. Make an request to confirm
return this.server.getDevices(this.number)
.then(this.connect.bind(this)) // No HTTP error? Reconnect