Remove devices with no keys
// FREEBIE
This commit is contained in:
parent
b73e7ac28f
commit
d89c3e8e86
2 changed files with 14 additions and 2 deletions
|
@ -38570,7 +38570,13 @@ OutgoingMessage.prototype = {
|
||||||
var promise = Promise.resolve();
|
var promise = Promise.resolve();
|
||||||
updateDevices.forEach(function(device) {
|
updateDevices.forEach(function(device) {
|
||||||
promise = promise.then(function() {
|
promise = promise.then(function() {
|
||||||
return this.server.getKeysForNumber(number, device).then(handleResult);
|
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
||||||
|
if (e.name === 'HTTPError' && e.code === 404 && device !== 1) {
|
||||||
|
return this.removeDeviceIdsForNumber(number, [device]);
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,13 @@ OutgoingMessage.prototype = {
|
||||||
var promise = Promise.resolve();
|
var promise = Promise.resolve();
|
||||||
updateDevices.forEach(function(device) {
|
updateDevices.forEach(function(device) {
|
||||||
promise = promise.then(function() {
|
promise = promise.then(function() {
|
||||||
return this.server.getKeysForNumber(number, device).then(handleResult);
|
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
||||||
|
if (e.name === 'HTTPError' && e.code === 404 && device !== 1) {
|
||||||
|
return this.removeDeviceIdsForNumber(number, [device]);
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue