1
0
Fork 0

fix 'false' appearing instead of 'high' or 'low'

master
Giles Booth 2022-08-19 17:30:14 +01:00 committed by GitHub
parent 08428e6501
commit 9e33e715d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -2,9 +2,9 @@
var FILE = "suw.json";
// Load settings
var settings = Object.assign({
nextTideHour: 11,
nextTideMin: 01,
nextTideType: "low ",
nextTideHour: 0,
nextTideMin: 0,
nextTideType: "high",
}, require('Storage').readJSON(FILE, true) || {});
function writeSettings() {
@ -16,7 +16,7 @@
"" : { "title" : "Seaside Watch" },
"< Back" : () => back(),
'High or low?': {
value: !!settings.nextTideType, // !! converts undefined to false
value: "high"|settings.nextTideType, // !! converts undefined to false
format: v => v?"high":"low ",
onchange: v => {
settings.nextTideType = v;