From 053eecc2ec86b90d4163f6c9dce0bcf70257af6c Mon Sep 17 00:00:00 2001 From: marko Date: Thu, 10 Sep 2020 17:13:00 -0400 Subject: [PATCH] Add option to zero total distance --- apps/cscsensor/settings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/cscsensor/settings.js b/apps/cscsensor/settings.js index 8a1c21de5..d7a7d565d 100644 --- a/apps/cscsensor/settings.js +++ b/apps/cscsensor/settings.js @@ -22,7 +22,6 @@ storage.write(SETTINGS_FILE, s); } } - const menu = { '': { 'title': 'Cycle speed sensor' }, '< Back': back, @@ -32,6 +31,14 @@ max: 2400, step: 5, 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);