From 197f9bb436df8e98fb6e4130e1e4b1b12dc921d5 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 18 Mar 2023 12:14:23 +0100 Subject: [PATCH] Don't go down extensions paths if nothing waits at the end --- apps/quicklaunch/ChangeLog | 1 + apps/quicklaunch/app.js | 14 +++++++++----- apps/quicklaunch/metadata.json | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/quicklaunch/ChangeLog b/apps/quicklaunch/ChangeLog index 0465a77e7..5d70e010b 100644 --- a/apps/quicklaunch/ChangeLog +++ b/apps/quicklaunch/ChangeLog @@ -14,3 +14,4 @@ settings page to prompt an automatic update of the quicklaunch.json settings file with new key names. 0.13: Touch and hold to pause the timeout to clock temporarily. +0.14: Extension: Don't go down a path if nothing waits at the end. Revisit the current intersection instead. diff --git a/apps/quicklaunch/app.js b/apps/quicklaunch/app.js index 22269c20d..2fc4910ab 100644 --- a/apps/quicklaunch/app.js +++ b/apps/quicklaunch/app.js @@ -9,16 +9,20 @@ }; let leaveTrace = function(trace) { - settings.trace = trace; - storage.writeJSON("quicklaunch.json", settings); + if (settings[trace+"app"].name != "") { + settings.trace = trace; + storage.writeJSON("quicklaunch.json", settings); + } else { trace = trace.substring(0, trace.length-1); } return trace; }; let launchApp = function(trace) { - if (settings[trace+"app"].src){ - if (settings[trace+"app"].name == "Show Launcher") Bangle.showLauncher(); else if (!storage.read(settings[trace+"app"].src)) reset(trace+"app"); else load(settings[trace+"app"].src); + if (settings[trace+"app"]) { + if (settings[trace+"app"].src){ + if (settings[trace+"app"].name == "Show Launcher") Bangle.showLauncher(); else if (!storage.read(settings[trace+"app"].src)) reset(trace+"app"); else load(settings[trace+"app"].src); + } } - } + }; let trace = settings.trace; diff --git a/apps/quicklaunch/metadata.json b/apps/quicklaunch/metadata.json index 945d98002..c2e3029f7 100644 --- a/apps/quicklaunch/metadata.json +++ b/apps/quicklaunch/metadata.json @@ -2,7 +2,7 @@ "id": "quicklaunch", "name": "Quick Launch", "icon": "app.png", - "version": "0.13", + "version": "0.14", "description": "Tap or swipe left/right/up/down on your clock face to launch up to five apps of your choice. Configurations can be accessed through Settings->Apps.", "type": "bootloader", "tags": "tools, system",