From f680be51d5e0b6a4160145341f761fa38bcd6d22 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 22 Jun 2023 10:04:46 +0100 Subject: [PATCH] Navigation messages no longer launch the Maps view unless they're new --- apps/android/ChangeLog | 1 + apps/android/boot.js | 2 ++ apps/android/metadata.json | 2 +- apps/messagegui/ChangeLog | 3 ++- apps/messagegui/app.js | 2 ++ apps/messagegui/metadata.json | 2 +- 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index 2e98a1237..f2807ba11 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -26,3 +26,4 @@ 0.25: Added option to 'ignore' an app from the message 0.26: Change handling of GPS status to depend on GPS events instead of connection events 0.27: Issue newline before GB commands (solves issue with console.log and ignored commands) +0.28: Navigation messages no longer launch the Maps view unless they're new \ No newline at end of file diff --git a/apps/android/boot.js b/apps/android/boot.js index 8e2e64dd0..d790a078e 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -203,6 +203,8 @@ event.t="add"; event.src="maps"; // for the icon event.title="Navigation"; + if (require("messages").getMessages().find(m=>m.id=="nav")) + event.t = "modify"; } else { event.t="remove"; } diff --git a/apps/android/metadata.json b/apps/android/metadata.json index 30890f12a..ed55e1192 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,7 +2,7 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.27", + "version": "0.28", "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", diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index 92c7f09a4..cedb0e680 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -97,4 +97,5 @@ 0.70: Handle nav messages from newer Gadgetbridge builds that output distance as a String If we receive a 'music' message and we're in the messages app (but not showing a message) show music (#2814) 0.71: Cancel buzzing when watch unlocked, or when different messages viewed - On 2v18.64+ firmware, 'No Messages' now has a 'back' button \ No newline at end of file + On 2v18.64+ firmware, 'No Messages' now has a 'back' button +0.72: Nav message updastes don't automatically launch navigation menu unless they're new \ No newline at end of file diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 395b56a4d..dc7799036 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -70,6 +70,8 @@ var onMessagesModified = function(type,msg) { if (msg.state && msg.state!="play") openMusic = false; // no longer playing music to go back to if ((active!=undefined) && (active!="list") && (active!="music")) return; // don't open music over other screens (but do if we're in the main menu) } + if (msg && msg.id=="nav" && msg.t=="modify" && active!="map") + return; // don't show an updated nav message if we're just in the menu showMessage(msg&&msg.id); }; Bangle.on("message", onMessagesModified); diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 9eb20a666..c71e5d542 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.71", + "version": "0.72", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app",