BangleApps/apps/setting/settings.js

708 lines
20 KiB
JavaScript
Raw Normal View History

2020-02-12 10:48:14 +00:00
Bangle.loadWidgets();
Bangle.drawWidgets();
const BANGLEJS2 = process.env.HWVERSION==2;
2019-11-06 22:12:54 +00:00
const storage = require('Storage');
let settings;
function updateSettings() {
//storage.erase('setting.json'); // - not needed, just causes extra writes if settings were the same
storage.write('setting.json', settings);
2019-11-06 22:12:54 +00:00
}
2020-04-03 20:43:38 +00:00
function updateOptions() {
var o = settings.options;
// Check to make sure nobody disabled all wakeups and locked themselves out!
if (BANGLEJS2) {
if (!(o.wakeOnBTN1||o.wakeOnFaceUp||o.wakeOnTouch||o.wakeOnTwist)) {
o.wakeOnBTN1 = true;
}
} else {
if (!(o.wakeOnBTN1||o.wakeOnBTN2||o.wakeOnBTN3||o.wakeOnFaceUp||o.wakeOnTouch||o.wakeOnTwist))
o.wakeOnBTN2 = true;
}
2020-04-03 20:43:38 +00:00
updateSettings();
Bangle.setOptions(o)
2020-04-03 20:43:38 +00:00
}
function gToInternal(g) {
// converts g to Espruino internal unit
return g * 8192;
}
function internalToG(u) {
// converts Espruino internal unit to g
return u / 8192
}
2019-11-06 22:12:54 +00:00
function resetSettings() {
settings = {
ble: true, // Bluetooth enabled by default
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
log: false, // Do log messages appear on screen?
quiet: 0, // quiet mode: 0: off, 1: priority only, 2: total silence
timeout: 10, // Default LCD timeout in seconds
vibrate: true, // Vibration enabled by default. App must support
beep: BANGLEJS2?true:"vib", // Beep enabled by default. App must support
timezone: 0, // Set the timezone for the device
2020-04-03 20:43:38 +00:00
HID: false, // BLE HID mode, off by default
clock: null, // a string for the default clock's name
"12hour" : false, // 12 or 24 hour clock?
2020-04-05 14:30:55 +00:00
brightness: 1, // LCD brightness from 0 to 1
// welcomed : undefined/true (whether welcome app should show)
2020-04-03 20:43:38 +00:00
options: {
wakeOnBTN1: true,
wakeOnBTN2: true,
wakeOnBTN3: true,
wakeOnFaceUp: false,
wakeOnTouch: false,
wakeOnTwist: true,
twistThreshold: 819.2,
twistMaxY: -800,
twistTimeout: 1000
},
2019-11-06 22:12:54 +00:00
};
updateSettings();
}
2020-04-03 20:43:38 +00:00
settings = storage.readJSON('setting.json', 1);
2019-11-06 22:12:54 +00:00
if (!settings) resetSettings();
const boolFormat = v => v ? /*LANG*/"On" : /*LANG*/"Off";
2019-11-06 22:12:54 +00:00
function showMainMenu() {
const mainmenu = {
'': { 'title': /*LANG*/'Settings' },
'< Back': ()=>load(),
/*LANG*/'Apps': ()=>showAppSettingsMenu(),
/*LANG*/'System': ()=>showSystemMenu(),
2022-01-02 16:40:49 +00:00
/*LANG*/'Bluetooth': ()=>showBLEMenu(),
/*LANG*/'Alerts': ()=>showAlertsMenu(),
2022-01-02 16:40:49 +00:00
/*LANG*/'Utils': ()=>showUtilMenu()
};
return E.showMenu(mainmenu);
}
function showSystemMenu() {
const mainmenu = {
'': { 'title': /*LANG*/'System' },
'< Back': ()=>showMainMenu(),
/*LANG*/'Theme': ()=>showThemeMenu(),
/*LANG*/'LCD': ()=>showLCDMenu(),
/*LANG*/'Locale': ()=>showLocaleMenu(),
/*LANG*/'Select Clock': ()=>showClockMenu(),
/*LANG*/'Set Time': ()=>showSetTimeMenu()
};
return E.showMenu(mainmenu);
}
function showAlertsMenu() {
var beepMenuItem;
if (BANGLEJS2) {
beepMenuItem = {
value: settings.beep!=false,
format: boolFormat,
onchange: v => {
settings.beep = v;
updateSettings();
if (settings.beep) {
analogWrite(VIBRATE,0.1,{freq:2000});
setTimeout(()=>VIBRATE.reset(),200);
} // beep with vibration moter
}
};
} else { // Bangle.js 1
var beepV = [false, true, "vib"];
var beepN = [/*LANG*/"Off", /*LANG*/"Piezo", /*LANG*/"Vibrate"];
beepMenuItem = {
value: Math.max(0 | beepV.indexOf(settings.beep),0),
min: 0, max: beepV.length-1,
format: v => beepN[v],
onchange: v => {
settings.beep = beepV[v];
if (v==1) { analogWrite(D18,0.5,{freq:2000});setTimeout(()=>D18.reset(),200); } // piezo on Bangle.js 1
else if (v==2) { analogWrite(VIBRATE,0.1,{freq:2000});setTimeout(()=>VIBRATE.reset(),200); } // vibrate
updateSettings();
}
};
}
2019-11-06 22:12:54 +00:00
const mainmenu = {
'': { 'title': /*LANG*/'Alerts' },
'< Back': ()=>showMainMenu(),
/*LANG*/'Beep': beepMenuItem,
/*LANG*/'Vibration': {
2019-11-06 22:12:54 +00:00
value: settings.vibrate,
format: boolFormat,
onchange: () => {
settings.vibrate = !settings.vibrate;
2019-11-06 22:12:54 +00:00
updateSettings();
if (settings.vibrate) {
VIBRATE.write(1);
2020-04-03 20:43:38 +00:00
setTimeout(() => VIBRATE.write(0), 10);
2019-11-06 22:12:54 +00:00
}
}
},
/*LANG*/"Quiet Mode": {
value: settings.quiet|0,
format: v => ["Off", "Alarms", "Silent"][v%3],
onchange: v => {
settings.quiet = v%3;
updateSettings();
updateOptions();
if ("qmsched" in WIDGETS) WIDGETS["qmsched"].draw();
},
}
};
return E.showMenu(mainmenu);
}
function showBLEMenu() {
2022-01-07 15:48:15 +00:00
var hidV = [false, "kbmedia", "kb", "com", "joy"];
var hidN = ["Off", "Kbrd & Media", "Kbrd", "Kbrd & Mouse" ,"Joystick"];
E.showMenu({
'': { 'title': 'Bluetooth' },
'< Back': ()=>showMainMenu(),
/*LANG*/'Make Connectable': ()=>makeConnectable(),
/*LANG*/'BLE': {
value: settings.ble,
format: boolFormat,
onchange: () => {
settings.ble = !settings.ble;
updateSettings();
}
},
/*LANG*/'Programmable': {
value: settings.blerepl,
format: boolFormat,
onchange: () => {
settings.blerepl = !settings.blerepl;
updateSettings();
}
},
/*LANG*/'HID': {
value: Math.max(0,0 | hidV.indexOf(settings.HID)),
min: 0, max: hidN.length-1,
2020-09-28 08:05:28 +00:00
format: v => hidN[v],
onchange: v => {
settings.HID = hidV[v];
updateSettings();
}
},
/*LANG*/'Passkey BETA': {
value: settings.passkey?settings.passkey:"none",
onchange: () => setTimeout(showPasskeyMenu) // graphical_menu redraws after the call
},
/*LANG*/'Whitelist': {
value: settings.whitelist?(settings.whitelist.length+" devs"):"off",
onchange: () => setTimeout(showWhitelistMenu) // graphical_menu redraws after the call
}
});
}
2021-06-24 15:09:40 +00:00
function showThemeMenu() {
function cl(x) { return g.setColor(x).getColor(); }
2021-10-06 19:14:22 +00:00
function upd(th) {
g.theme = th;
settings.theme = th;
updateSettings();
delete g.reset;
g._reset = g.reset;
g.reset = function(n) { return g._reset().setColor(th.fg).setBgColor(th.bg); };
g.clear = function(n) { if (n) g.reset(); return g.clearRect(0,0,g.getWidth(),g.getHeight()); };
g.clear(1);
Bangle.drawWidgets();
m.draw();
}
var m = E.showMenu({
2022-01-19 11:49:59 +00:00
'':{title:/*LANG*/'Theme'},
'< Back': ()=>showSystemMenu(),
/*LANG*/'Dark BW': ()=>{
2021-10-06 19:14:22 +00:00
upd({
2021-06-24 15:09:40 +00:00
fg:cl("#fff"), bg:cl("#000"),
fg2:cl("#0ff"), bg2:cl("#000"),
fgH:cl("#fff"), bgH:cl("#00f"),
dark:true
});
},
/*LANG*/'Light BW': ()=>{
2021-10-06 19:14:22 +00:00
upd({
2021-06-24 15:09:40 +00:00
fg:cl("#000"), bg:cl("#fff"),
2021-11-02 15:36:19 +00:00
fg2:cl("#000"), bg2:cl("#cff"),
2021-06-30 12:52:52 +00:00
fgH:cl("#000"), bgH:cl("#0ff"),
2021-06-24 15:09:40 +00:00
dark:false
});
},
/*LANG*/'Customize': ()=>showCustomThemeMenu(),
2021-10-03 18:40:27 +00:00
});
2021-10-06 19:14:22 +00:00
function showCustomThemeMenu() {
function setT(t, v) {
let th = g.theme;
th[t] = v;
if (t==="bg") {
th['dark'] = (v===cl("#000"));
2021-10-06 19:14:22 +00:00
}
2021-10-06 19:17:34 +00:00
upd(th);
2021-10-03 18:40:27 +00:00
}
2021-10-06 19:14:22 +00:00
const rgb = {
black: "#000", white: "#fff",
red: "#f00", green: "#0f0", blue: "#00f",
cyan: "#0ff", magenta: "#f0f", yellow: "#ff0",
};
let colors = [], names = [];
for(const c in rgb) {
names.push(c);
colors.push(cl(rgb[c]));
2021-10-06 19:14:22 +00:00
}
let menu = {
2021-10-06 19:17:34 +00:00
'':{title:'Custom Theme'},
"< Back": () => showThemeMenu()
2021-10-06 19:14:22 +00:00
};
const labels = {
fg: /*LANG*/'Foreground', bg: /*LANG*/'Background',
fg2: /*LANG*/'Foreground 2', bg2: /*LANG*/'Background 2',
fgH: /*LANG*/'Highlight FG', bgH: /*LANG*/'Highlight BG',
2021-10-06 19:14:22 +00:00
};
["fg", "bg", "fg2", "bg2", "fgH", "bgH"].forEach(t => {
menu[labels[t]] = {
min : 0, max : colors.length-1, wrap : true,
value: Math.max(colors.indexOf(g.theme[t]),0),
format: v => names[v],
2021-10-06 19:14:22 +00:00
onchange: function(v) {
var c = colors[v];
2021-10-06 19:14:22 +00:00
// if we select the same fg and bg: set the other to the old color
// e.g. bg=black;fg=white, user selects fg=black -> bg changes to white automatically
// so users don't end up with a black-on-black menu
if (t === 'fg' && g.theme.bg === c) setT('bg', g.theme.fg);
if (t === 'bg' && g.theme.fg === c) setT('fg', g.theme.bg);
setT(t, c);
},
};
});
menu["< Back"] = () => showThemeMenu();
m = E.showMenu(menu);
2021-10-03 18:40:27 +00:00
}
2021-06-24 15:09:40 +00:00
}
function showPasskeyMenu() {
var menu = {
"< Back" : ()=>showBLEMenu(),
/*LANG*/"Disable" : () => {
settings.passkey = undefined;
updateSettings();
showBLEMenu();
}
};
if (!settings.passkey || settings.passkey.length!=6) {
settings.passkey = "123456";
updateSettings();
}
for (var i=0;i<6;i++) (function(i){
menu[`Digit ${i+1}`] = {
value : 0|settings.passkey[i],
min: 0, max: 9,
onchange: v => {
var p = settings.passkey.split("");
p[i] = v;
settings.passkey = p.join("");
updateSettings();
}
};
})(i);
E.showMenu(menu);
}
function showWhitelistMenu() {
var menu = {
"< Back" : ()=>showBLEMenu(),
/*LANG*/"Disable" : () => {
settings.whitelist = undefined;
updateSettings();
showBLEMenu();
}
};
if (settings.whitelist) settings.whitelist.forEach(function(d){
menu[d.substr(0,17)] = function() {
E.showPrompt(/*LANG*/'Remove\n'+d).then((v) => {
2021-10-06 19:14:22 +00:00
if (v) {
settings.whitelist.splice(settings.whitelist.indexOf(d),1);
updateSettings();
}
setTimeout(showWhitelistMenu, 50);
});
}
});
menu[/*LANG*/'Add Device']=function() {
E.showAlert(/*LANG*/"Connect device\nto add to\nwhitelist",/*LANG*/"Whitelist").then(function() {
NRF.removeAllListeners('connect');
showWhitelistMenu();
});
NRF.removeAllListeners('connect');
NRF.on('connect', function(addr) {
if (!settings.whitelist) settings.whitelist=[];
settings.whitelist.push(addr);
updateSettings();
NRF.removeAllListeners('connect');
showWhitelistMenu();
});
};
E.showMenu(menu);
}
function showLCDMenu() {
const lcdMenu = {
'': { 'title': 'LCD' },
'< Back': ()=>showSystemMenu(),
/*LANG*/'LCD Brightness': {
value: settings.brightness,
min: 0.1,
max: 1,
step: 0.1,
onchange: v => {
settings.brightness = v || 1;
updateSettings();
Bangle.setLCDBrightness(settings.brightness);
}
},
/*LANG*/'LCD Timeout': {
value: settings.timeout,
min: 0,
max: 60,
step: 5,
onchange: v => {
settings.timeout = 0 | v;
updateSettings();
Bangle.setLCDTimeout(settings.timeout);
}
},
/*LANG*/'Wake on BTN1': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnBTN1,
format: boolFormat,
onchange: () => {
settings.options.wakeOnBTN1 = !settings.options.wakeOnBTN1;
updateOptions();
}
}
};
if (!BANGLEJS2)
Object.assign(lcdMenu, {
/*LANG*/'Wake on BTN2': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnBTN2,
format: boolFormat,
onchange: () => {
settings.options.wakeOnBTN2 = !settings.options.wakeOnBTN2;
updateOptions();
}
},
/*LANG*/'Wake on BTN3': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnBTN3,
format: boolFormat,
onchange: () => {
settings.options.wakeOnBTN3 = !settings.options.wakeOnBTN3;
updateOptions();
}
}});
Object.assign(lcdMenu, {
/*LANG*/'Wake on FaceUp': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnFaceUp,
format: boolFormat,
onchange: () => {
settings.options.wakeOnFaceUp = !settings.options.wakeOnFaceUp;
updateOptions();
}
},
/*LANG*/'Wake on Touch': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnTouch,
format: boolFormat,
onchange: () => {
settings.options.wakeOnTouch = !settings.options.wakeOnTouch;
updateOptions();
}
},
/*LANG*/'Wake on Twist': {
2020-04-03 20:43:38 +00:00
value: settings.options.wakeOnTwist,
format: boolFormat,
onchange: () => {
settings.options.wakeOnTwist = !settings.options.wakeOnTwist;
updateOptions();
}
},
/*LANG*/'Twist Threshold': {
2020-04-03 20:43:38 +00:00
value: internalToG(settings.options.twistThreshold),
min: -0.5,
max: 0.5,
step: 0.01,
onchange: v => {
settings.options.twistThreshold = gToInternal(v || 0.1);
updateOptions();
}
},
/*LANG*/'Twist Max Y': {
2020-04-03 20:43:38 +00:00
value: settings.options.twistMaxY,
min: -1500,
max: 1500,
step: 100,
onchange: v => {
settings.options.twistMaxY = v || -800;
updateOptions();
}
},
/*LANG*/'Twist Timeout': {
2020-04-03 20:43:38 +00:00
value: settings.options.twistTimeout,
min: 0,
max: 2000,
step: 100,
onchange: v => {
settings.options.twistTimeout = v || 1000;
updateOptions();
}
}
});
return E.showMenu(lcdMenu)
2020-04-03 20:43:38 +00:00
}
function showLocaleMenu() {
const localemenu = {
'': { 'title': /*LANG*/'Locale' },
'< Back': ()=>showSystemMenu(),
/*LANG*/'Time Zone': {
2019-11-06 22:12:54 +00:00
value: settings.timezone,
min: -11,
max: 13,
2019-12-18 21:23:35 +00:00
step: 0.5,
2019-11-06 22:12:54 +00:00
onchange: v => {
settings.timezone = v || 0;
2019-11-06 22:12:54 +00:00
updateSettings();
}
},
/*LANG*/'Clock Style': {
value: !!settings["12hour"],
2020-04-03 20:43:38 +00:00
format: v => v ? "12hr" : "24hr",
onchange: v => {
settings["12hour"] = v;
2019-11-08 15:54:57 +00:00
updateSettings();
}
}
2019-11-06 22:12:54 +00:00
};
return E.showMenu(localemenu);
2019-11-06 22:12:54 +00:00
}
function showUtilMenu() {
var menu = {
'': { 'title': /*LANG*/'Utilities' },
'< Back': ()=>showMainMenu(),
/*LANG*/'Debug Info': {
value: E.clip(0|settings.log,0,2),
2021-12-24 03:03:45 +00:00
min: 0,
max: 2,
format: v => [/*LANG*/"Hide",/*LANG*/"Show",/*LANG*/"Log"][E.clip(0|v,0,2)],
onchange: v => {
settings.log = v;
updateSettings();
}
},
/*LANG*/'Compact Storage': () => {
E.showMessage(/*LANG*/"Compacting...\nTakes approx\n1 minute",{title:/*LANG*/"Storage"});
require("Storage").compact();
showUtilMenu();
},
/*LANG*/'Rewrite Settings': () => {
require("Storage").write(".boot0","eval(require('Storage').read('bootupdate.js'));");
load("setting.app.js");
},
/*LANG*/'Flatten Battery': () => {
E.showMessage(/*LANG*/'Flattening battery - this can take hours.\nLong-press button to cancel.');
Bangle.setLCDTimeout(0);
Bangle.setLCDPower(1);
if (Bangle.setGPSPower) Bangle.setGPSPower(1,"flat");
if (Bangle.setHRMPower) Bangle.setHRMPower(1,"flat");
if (Bangle.setCompassPower) Bangle.setCompassPower(1,"flat");
if (Bangle.setBarometerPower) Bangle.setBarometerPower(1,"flat");
if (Bangle.setHRMPower) Bangle.setGPSPower(1,"flat");
setInterval(function() {
var i=1000;while (i--);
}, 1);
},
/*LANG*/'Reset Settings': () => {
E.showPrompt(/*LANG*/'Reset to Defaults?',{title:/*LANG*/"Settings"}).then((v) => {
2019-11-06 22:12:54 +00:00
if (v) {
E.showMessage('Resetting');
resetSettings();
setTimeout(showMainMenu, 50);
} else showUtilMenu();
2019-11-06 22:12:54 +00:00
});
2022-01-02 16:40:49 +00:00
},
/*LANG*/'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() }
2019-11-06 22:12:54 +00:00
};
if (Bangle.factoryReset) {
menu[/*LANG*/'Factory Reset'] = ()=>{
E.showPrompt(/*LANG*/'This will remove everything!',{title:/*LANG*/"Factory Reset"}).then((v) => {
if (v) {
E.showMessage();
Terminal.setConsole();
Bangle.factoryReset();
} else showUtilMenu();
});
}
}
return E.showMenu(menu);
2019-11-06 22:12:54 +00:00
}
function makeConnectable() {
2020-04-03 20:43:38 +00:00
try { NRF.wake(); } catch (e) { }
2019-11-10 11:46:05 +00:00
Bluetooth.setConsole(1);
2020-04-03 20:43:38 +00:00
var name = "Bangle.js " + NRF.getAddress().substr(-5).replace(":", "");
E.showPrompt(name + /*LANG*/"\nStay Connectable?", { title: /*LANG*/"Connectable" }).then(r => {
2020-04-03 20:43:38 +00:00
if (settings.ble != r) {
settings.ble = r;
updateSettings();
}
2020-04-03 20:43:38 +00:00
if (!r) try { NRF.sleep(); } catch (e) { }
showMainMenu();
});
}
function showClockMenu() {
var clockApps = require("Storage").list(/\.info$/)
.map(app => {var a=storage.readJSON(app, 1);return (a&&a.type == "clock")?a:undefined})
.filter(app => app) // filter out any undefined apps
.sort((a, b) => a.sortorder - b.sortorder);
const clockMenu = {
'': {
'title': /*LANG*/'Select Clock',
},
'< Back': ()=>showSystemMenu(),
};
2020-04-03 20:43:38 +00:00
clockApps.forEach((app, index) => {
var label = app.name;
if ((!settings.clock && index === 0) || (settings.clock === app.src)) {
2020-04-03 20:43:38 +00:00
label = "* " + label;
}
clockMenu[label] = () => {
if (settings.clock !== app.src) {
settings.clock = app.src;
updateSettings();
showMainMenu();
}
};
});
if (clockApps.length === 0) {
clockMenu[/*LANG*/"No Clocks Found"] = () => { };
}
2020-01-17 11:32:32 +00:00
return E.showMenu(clockMenu);
}
function showSetTimeMenu() {
d = new Date();
const timemenu = {
'': { 'title': /*LANG*/'Set Time' },
'< Back': function () {
setTime(d.getTime() / 1000);
showSystemMenu();
},
/*LANG*/'Hour': {
value: d.getHours(),
onchange: function (v) {
this.value = (v+24)%24;
d.setHours(this.value);
}
},
/*LANG*/'Minute': {
value: d.getMinutes(),
onchange: function (v) {
this.value = (v+60)%60;
d.setMinutes(this.value);
}
},
/*LANG*/'Second': {
value: d.getSeconds(),
onchange: function (v) {
this.value = (v+60)%60;
d.setSeconds(this.value);
}
},
/*LANG*/'Date': {
value: d.getDate(),
onchange: function (v) {
2020-06-08 14:45:16 +00:00
this.value = ((v+30)%31)+1;
d.setDate(this.value);
}
},
/*LANG*/'Month': {
value: d.getMonth() + 1,
onchange: function (v) {
this.value = ((v+11)%12)+1;
d.setMonth(this.value - 1);
}
},
/*LANG*/'Year': {
value: d.getFullYear(),
2019-11-20 08:19:56 +00:00
min: 2019,
max: 2100,
onchange: function (v) {
d.setFullYear(v);
}
}
};
2020-01-17 11:32:32 +00:00
return E.showMenu(timemenu);
}
function showAppSettingsMenu() {
let appmenu = {
'': { 'title': /*LANG*/'App Settings' },
'< Back': ()=>showMainMenu(),
}
2020-04-17 19:08:07 +00:00
const apps = storage.list(/\.settings\.js$/)
.map(s => s.substr(0, s.length-12))
.map(id => {
const a=storage.readJSON(id+'.info',1) || {name: id};
2020-04-17 19:08:07 +00:00
return {id:id,name:a.name,sortorder:a.sortorder};
})
.sort((a, b) => {
const n = (0|a.sortorder)-(0|b.sortorder);
if (n) return n; // do sortorder first
if (a.name<b.name) return -1;
if (a.name>b.name) return 1;
return 0;
})
if (apps.length === 0) {
appmenu[/*LANG*/'No app has settings'] = () => { };
}
apps.forEach(function (app) {
appmenu[app.name] = () => { showAppSettings(app) };
})
E.showMenu(appmenu)
}
function showAppSettings(app) {
const showError = msg => {
E.showMessage(`${app.name}:\n${msg}!\n\nBTN1 to go back`);
setWatch(showAppSettingsMenu, BTN1, { repeat: false });
}
2020-04-17 19:08:07 +00:00
let appSettings = storage.read(app.id+'.settings.js');
try {
appSettings = eval(appSettings);
} catch (e) {
console.log(`${app.name} settings error:`, e)
return showError(/*LANG*/'Error in settings');
}
if (typeof appSettings !== "function") {
return showError(/*LANG*/'Invalid settings');
}
try {
// pass showAppSettingsMenu as "back" argument
2020-04-11 23:29:57 +00:00
appSettings(()=>showAppSettingsMenu());
} catch (e) {
console.log(`${app.name} settings error:`, e)
return showError(/*LANG*/'Error in settings');
}
}
2019-11-06 22:12:54 +00:00
showMainMenu();