mirror of https://github.com/espruino/BangleApps
drained: use Bangle's bool formatter
parent
e489b26834
commit
efe023c5cb
|
@ -21,8 +21,6 @@ type DrainedSettings = {
|
||||||
storage.writeJSON(SETTINGS_FILE, settings)
|
storage.writeJSON(SETTINGS_FILE, settings)
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatBool = (b: boolean) => b ? "On" : "Off";
|
|
||||||
|
|
||||||
const menu: Menu = {
|
const menu: Menu = {
|
||||||
"": { "title": "Drained" },
|
"": { "title": "Drained" },
|
||||||
"< Back": back,
|
"< Back": back,
|
||||||
|
@ -61,7 +59,6 @@ type DrainedSettings = {
|
||||||
},
|
},
|
||||||
"Keep startup code": {
|
"Keep startup code": {
|
||||||
value: settings.keepStartup as boolean,
|
value: settings.keepStartup as boolean,
|
||||||
format: formatBool,
|
|
||||||
onchange: (b: boolean) => {
|
onchange: (b: boolean) => {
|
||||||
settings.keepStartup = b;
|
settings.keepStartup = b;
|
||||||
save();
|
save();
|
||||||
|
@ -88,7 +85,6 @@ type DrainedSettings = {
|
||||||
.forEach((name: string) => {
|
.forEach((name: string) => {
|
||||||
bootExceptions[name] = {
|
bootExceptions[name] = {
|
||||||
value: settings.exceptions!.indexOf(name) >= 0,
|
value: settings.exceptions!.indexOf(name) >= 0,
|
||||||
format: formatBool,
|
|
||||||
onchange: (b: boolean) => {
|
onchange: (b: boolean) => {
|
||||||
if (b) {
|
if (b) {
|
||||||
settings.exceptions!.push(name);
|
settings.exceptions!.push(name);
|
||||||
|
|
Loading…
Reference in New Issue