Add option to zero total distance

master
marko 2020-09-10 17:13:00 -04:00
parent ad11fa3c2c
commit 053eecc2ec
1 changed files with 8 additions and 1 deletions

View File

@ -22,7 +22,6 @@
storage.write(SETTINGS_FILE, s); storage.write(SETTINGS_FILE, s);
} }
} }
const menu = { const menu = {
'': { 'title': 'Cycle speed sensor' }, '': { 'title': 'Cycle speed sensor' },
'< Back': back, '< Back': back,
@ -32,6 +31,14 @@
max: 2400, max: 2400,
step: 5, step: 5,
onchange: save('wheelcirc'), onchange: save('wheelcirc'),
},
'Reset total distance': function() {
E.showPrompt("Zero total distance?", {buttons: {"No":false, "Yes":true}}).then(function(v) {
if (v) {
s['totaldist'] = 0;
storage.write(SETTINGS_FILE, s);
}
}).then(back);
} }
} }
E.showMenu(menu); E.showMenu(menu);