mirror of https://github.com/espruino/BangleApps
Merge pull request #3176 from bobrippling/fix/improve-formatter-check
Improve boolean formatter checkpull/3186/head
commit
5a2b5405f2
|
@ -17,7 +17,6 @@
|
|||
"< Back" : () => back(),
|
||||
'Show Seconds': {
|
||||
value: !!settings.showSeconds, // !! converts undefined to false
|
||||
format: v => v ? "On" : "Off",
|
||||
onchange: v => {
|
||||
settings.showSeconds = v;
|
||||
writeSettings();
|
||||
|
@ -25,7 +24,6 @@
|
|||
},
|
||||
'Invert Scrolling': {
|
||||
value: !!settings.invertScrolling, // !! converts undefined to false
|
||||
format: v => v ? "On" : "Off",
|
||||
onchange: v => {
|
||||
settings.invertScrolling = v;
|
||||
writeSettings();
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
"< Back": () => back(),
|
||||
'Front Tap:': {
|
||||
value: (appSettings.enableTap === true),
|
||||
format: v => v ? "On" : "Off",
|
||||
onchange: v => {
|
||||
appSettings.enableTap = v;
|
||||
writeSettings();
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
'': { 'title': 'Welcome App' },
|
||||
'Run next boot': {
|
||||
value: !settings.welcomed,
|
||||
format: v => v ? 'Yes' : 'No',
|
||||
onchange: v => require('Storage').write('mywelcome.json', {welcomed: !v}),
|
||||
},
|
||||
'Run Now': () => load('mywelcome.app.js'),
|
||||
|
|
|
@ -130,7 +130,6 @@
|
|||
},
|
||||
'Date Suffix:': {
|
||||
value: appSettings.enableSuffix,
|
||||
format: v => v ? 'Yes' : 'No',
|
||||
onchange: v => {
|
||||
appSettings.enableSuffix = v;
|
||||
writeSettings();
|
||||
|
@ -138,7 +137,6 @@
|
|||
},
|
||||
'Lead Zero:': {
|
||||
value: appSettings.enableLeadingZero,
|
||||
format: v => v ? 'Yes' : 'No',
|
||||
onchange: v => {
|
||||
appSettings.enableLeadingZero = v;
|
||||
writeSettings();
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
'': { 'title': 'Welcome App' },
|
||||
'Run next boot': {
|
||||
value: !settings.welcomed,
|
||||
format: v => v ? 'Yes' : 'No',
|
||||
onchange: v => require('Storage').write('welcome.json', {welcomed: !v}),
|
||||
},
|
||||
'Run Now': () => load('welcome.app.js'),
|
||||
|
|
|
@ -263,7 +263,7 @@ apps.forEach((app,appIdx) => {
|
|||
WARN(`App ${app.id} has a setting file but no corresponding data entry (add \`"data":[{"name":"${app.id}.settings.json"}]\`)`, {file:appDirRelative+file.url});
|
||||
}
|
||||
// check for manual boolean formatter
|
||||
const m = fileContents.match(/format: *\(\) *=>.*["'](yes|on)["']/i);
|
||||
const m = fileContents.match(/format: *\(?\w*\)? *=>.*["'](yes|on)["']/i);
|
||||
if (m) {
|
||||
WARN(`Settings for ${app.id} has a boolean formatter - this is handled automatically, the line can be removed`, {file:appDirRelative+file.url, line: fileContents.substr(0, m.index).split("\n").length});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue