diff --git a/v2/api/builder/apifield.css b/v2/api/builder/apifield.css index aff8b7d..dfef4b9 100644 --- a/v2/api/builder/apifield.css +++ b/v2/api/builder/apifield.css @@ -1,6 +1,3 @@ #apibuilder .bar:before, #apibuilder .bar:after { background:white; -} -#apifield{ - margin-bottom:45px; } \ No newline at end of file diff --git a/v2/api/sender.js b/v2/api/sender.js index 2d950fa..1dc5b57 100644 --- a/v2/api/sender.js +++ b/v2/api/sender.js @@ -38,8 +38,12 @@ export class SendResults extends Array { this.merge(results) } merge(other){ - for(var result of other){ - this.push(new SendResult(result.messageId,result.success,result.message)); + try{ + for(var result of other){ + this.push(new SendResult(result.messageId,result.success,result.message)); + } + }catch{ + //do nothing if other is not iterable } this.success = this.count(result=>result.success); this.failure = this.count(result=>!result.success); diff --git a/v2/device/apphelperdevices.js b/v2/device/apphelperdevices.js index 970de54..e2fc587 100644 --- a/v2/device/apphelperdevices.js +++ b/v2/device/apphelperdevices.js @@ -223,7 +223,8 @@ export class AppHelperDevices extends AppHelperBase{ } async onRequestResetApiKey(){ try{ - if(!this.confirmApiKeyDelete()) return; + const shouldReset = await this.confirmApiKeyDelete(); + if(!shouldReset) return; this._apiKey = await ApiServer.resetApiKey(); app.showToast({text:`API Key reset!`}); @@ -234,7 +235,9 @@ export class AppHelperDevices extends AppHelperBase{ } async onRequestDeleteApiKey(){ try{ - if(!this.confirmApiKeyDelete()) return; + const shouldReset = await this.confirmApiKeyDelete(); + if(!shouldReset) return; + await ApiServer.deleteApiKey(); this._apiKey = null; await this.apiBuilder.generateUrl(null);