make timeout to clock work

pull/2235/head
thyttan 2022-11-06 20:20:51 +01:00
parent 479f0e3d69
commit 675953ddcd
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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();
} }
}, },
}); });
}) });