update timeout to clock per new implementation in Icon Launcher

master
thyttan 2022-11-06 21:27:40 +01:00
parent 23a0c2fc2f
commit ef1cf7ef7b
1 changed files with 12 additions and 7 deletions

View File

@ -182,9 +182,14 @@ const returnToClock = function() {
}; };
// taken from Icon Launcher with minor alterations // taken from Icon Launcher with minor alterations
if (settings.timeOut!="Off"){ var timeoutToClock;
let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt const updateTimeoutToClock = function(){
var timeoutToClock = setTimeout(returnToClock,time*1000); if (settings.timeOut!="Off"){
} let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt
if (timeoutToClock) clearTimeout(timeoutToClock);
timeoutToClock = setTimeout(returnToClock,time*1000);
}
};
updateTimeoutToClock();
} // end of app scope } // end of app scope