From 1b20bb6af88b2fa4591c1f81bbb6cd996a1a32a1 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 28 Sep 2022 09:15:04 +0100 Subject: [PATCH] 0.16: Bangle.http now fails immediately if there is no Bluetooth connection (fix #2152) --- apps/android/ChangeLog | 1 + apps/android/boot.js | 2 ++ apps/android/metadata.json | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index 0cc7aedd4..a65326941 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -13,3 +13,4 @@ 0.13: Added Bangle.http function (see Readme file for more info) 0.14: Fix timeout of http function not being cleaned up 0.15: Allow method/body/headers to be specified for `http` (needs Gadgetbridge 0.68.0b or later) +0.16: Bangle.http now fails immediately if there is no Bluetooth connection (fix #2152) diff --git a/apps/android/boot.js b/apps/android/boot.js index bc8e3032d..0d1edae99 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -139,6 +139,8 @@ // options = {id,timeout,xpath} Bangle.http = (url,options)=>{ options = options||{}; + if (!NRF.getSecurityStatus().connected) + return Promise.reject("Not connected to Bluetooth"); if (Bangle.httpRequest === undefined) Bangle.httpRequest={}; if (options.id === undefined) { diff --git a/apps/android/metadata.json b/apps/android/metadata.json index 5d1b2f561..ab340340c 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,7 +2,7 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.15", + "version": "0.16", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "icon": "app.png", "tags": "tool,system,messages,notifications,gadgetbridge",