Skip to content

Commit ac7ed7d

Browse files
author
thyttan
committed
quicklaunch: undo timeout, load settings on demand
1 parent e8ef71e commit ac7ed7d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/quicklaunch/boot.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
2-
setTimeout(() => { // wrap in zero ms timeout so the foreground app loads first.
32
const storage = require("Storage");
4-
let settings = storage.readJSON("quicklaunch.json", true) || {};
3+
let settings;
54

65
let leaveTrace = function(trace) {
6+
if (!settings) settings = storage.readJSON("quicklaunch.json", true) || {};
7+
78
settings.trace = trace;
89
storage.writeJSON("quicklaunch.json", settings);
910
return trace;
1011
};
1112

1213
let launchApp = function(trace) {
14+
if (!settings) settings = storage.readJSON("quicklaunch.json", true) || {};
15+
1316
if (settings[trace+"app"].src){
1417
if (settings[trace+"app"].name == "Show Launcher") Bangle.showLauncher();
1518
else if (!storage.read(settings[trace+"app"].src)) {
@@ -41,5 +44,4 @@ setTimeout(() => { // wrap in zero ms timeout so the foreground app loads first.
4144
if (ud == 1) trace = leaveTrace("d"); // d=down.
4245
launchApp(trace);
4346
});
44-
}, 0);
4547
}

0 commit comments

Comments
 (0)