minor fixes for last commit, rename 'clockApp' to make name conflicts even less likely
parent
a8d7b7c09a
commit
48d9367e2f
|
|
@ -1,8 +1,8 @@
|
|||
// This runs after a 'fresh' boot
|
||||
var s = require("Storage").readJSON("setting.json",1)||{};
|
||||
var clockApp = require("Storage").read(s.clock);
|
||||
if (!clockApp) {
|
||||
clockApp = require("Storage").list(/\.info$/)
|
||||
var _clkApp = require("Storage").read(s.clock);
|
||||
if (!_clkApp) {
|
||||
_clkApp = require("Storage").list(/\.info$/)
|
||||
.map(file => {
|
||||
const app = require("Storage").readJSON(file,1);
|
||||
if (app && app.type == "clock") {
|
||||
|
|
@ -11,13 +11,13 @@ if (!clockApp) {
|
|||
})
|
||||
.filter(x=>x)
|
||||
.sort((a, b) => a.sortorder - b.sortorder)[0];
|
||||
if (clockApp){
|
||||
clockApp = require("Storage").read(clockApp.src);
|
||||
s.clock = clockApp.src;
|
||||
if (_clkApp){
|
||||
s.clock = _clkApp.src;
|
||||
_clkApp = require("Storage").read(_clkApp.src);
|
||||
require("Storage").writeJSON("setting.json", s);
|
||||
}
|
||||
}
|
||||
if (!clockApp) clockApp=`E.showMessage("No Clock Found");setWatch(()=>{Bangle.showLauncher();}, global.BTN2||BTN, {repeat:false,edge:"falling"});`;
|
||||
eval(clockApp);
|
||||
delete s;
|
||||
delete clockApp;
|
||||
if (!_clkApp) _clkApp=`E.showMessage("No Clock Found");setWatch(()=>{Bangle.showLauncher();}, global.BTN2||BTN, {repeat:false,edge:"falling"});`;
|
||||
eval(_clkApp);
|
||||
delete _clkApp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue