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