mirror of https://github.com/espruino/BangleApps
make timeout to clock work
parent
479f0e3d69
commit
675953ddcd
|
@ -15,13 +15,8 @@ let settings = Object.assign({
|
||||||
|
|
||||||
if (settings.oneClickExit) {
|
if (settings.oneClickExit) {
|
||||||
var buttonWatch = setWatch(_=> returnToClock, BTN1);
|
var buttonWatch = setWatch(_=> returnToClock, BTN1);
|
||||||
}
|
|
||||||
|
|
||||||
// taken from Icon Launcher with minor alterations
|
|
||||||
if (settings.timeOut!="Off"){
|
|
||||||
let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt
|
|
||||||
var timeoutToClock = setTimeout(returnToClock,time*1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let s = require("Storage");
|
let s = require("Storage");
|
||||||
var apps = s.list(/\.info$/).map(app=>{
|
var apps = s.list(/\.info$/).map(app=>{
|
||||||
let a=s.readJSON(app,1);
|
let a=s.readJSON(app,1);
|
||||||
|
@ -186,4 +181,10 @@ const returnToClock = function() {
|
||||||
setTimeout(eval, 0, s.read(".bootcde"));
|
setTimeout(eval, 0, s.read(".bootcde"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// taken from Icon Launcher with minor alterations
|
||||||
|
if (settings.timeOut!="Off"){
|
||||||
|
let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt
|
||||||
|
var timeoutToClock = setTimeout(returnToClock,time*1000);
|
||||||
|
}
|
||||||
|
|
||||||
} // end of app scope
|
} // end of app scope
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
min: 0,
|
min: 0,
|
||||||
max: timeOutChoices.length-1,
|
max: timeOutChoices.length-1,
|
||||||
format: v => timeOutChoices[v],
|
format: v => timeOutChoices[v],
|
||||||
onchange: m => {
|
onchange: v => {
|
||||||
settings.timeOut = m;
|
settings.timeOut = timeOutChoices[v];
|
||||||
writeSettings();
|
writeSettings();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
Loading…
Reference in New Issue