From 6195b876640034c64e12aa221f47e72e1eb455a1 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Wed, 13 Nov 2024 22:05:15 +0100 Subject: [PATCH] quicklaunch: easier to read if-else --- apps/quicklaunch/boot.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/quicklaunch/boot.js b/apps/quicklaunch/boot.js index 5c4f9b88c..5c99e86f9 100644 --- a/apps/quicklaunch/boot.js +++ b/apps/quicklaunch/boot.js @@ -13,16 +13,17 @@ let launchApp = function(trace) { if (!settings) settings = storage.readJSON("quicklaunch.json", true) || {}; - if (settings[trace+"app"].src){ - if (settings[trace+"app"].name == "Show Launcher") Bangle.showLauncher(); - else if (!storage.read(settings[trace+"app"].src)) { - E.showMessage(settings[trace+"app"].src+"\n"+/*LANG*/"was not found"+".", "Quick Launch"); - settings[trace+"app"] = {"name":"(none)"}; // reset entry. - storage.write("quicklaunch.json", settings); - setTimeout(load, 2000); - } else load(settings[trace+"app"].src); + if (settings[trace+"app"].src) { + if (settings[trace+"app"].name == "Show Launcher") { + Bangle.showLauncher(); + } else if (!storage.read(settings[trace+"app"].src)) { + E.showMessage(settings[trace+"app"].src+"\n"+/*LANG*/"was not found"+".", "Quick Launch"); + settings[trace+"app"] = {"name":"(none)"}; // reset entry. + storage.write("quicklaunch.json", settings); + setTimeout(load, 2000); + } else {load(settings[trace+"app"].src);} } - } + }; let trace;