Skip to content

Commit

Permalink
quicklaunch: easier to read if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Nov 13, 2024
1 parent ac7ed7d commit 6195b87
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions apps/quicklaunch/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6195b87

Please sign in to comment.