Merge pull request #3431 from bobrippling/feat/run-noprompt

runplus: add option to always resume
pull/3446/head
thyttan 2024-06-05 00:40:27 +02:00 committed by GitHub
commit 946d72205c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View File

@ -27,3 +27,4 @@ Write to correct settings file, fixing settings not working.
0.24: Add indicators for lock,gps and pulse to karvonen screen 0.24: Add indicators for lock,gps and pulse to karvonen screen
0.25: Fix step count bug when runs are resumed after a long time 0.25: Fix step count bug when runs are resumed after a long time
0.26: Add ability to zoom in on a single stat by tapping it 0.26: Add ability to zoom in on a single stat by tapping it
0.27: Allow setting to alway resume an activity

View File

@ -26,6 +26,7 @@ let settings = Object.assign({
B5: "step", B5: "step",
B6: "caden", B6: "caden",
paceLength: 1000, paceLength: 1000,
alwaysResume: false,
notify: { notify: {
dist: { dist: {
value: 0, value: 0,
@ -64,10 +65,10 @@ function onStartStop() {
} }
var running = !exs.state.active; var running = !exs.state.active;
var shouldResume = false; var shouldResume = settings.alwaysResume;
var promise = Promise.resolve(); var promise = Promise.resolve();
if (running && exs.state.duration > 10000) { // if more than 10 seconds of duration, ask if we should resume? if (!shouldResume && running && exs.state.duration > 10000) { // if more than 10 seconds of duration, ask if we should resume?
promise = promise. promise = promise.
then(() => { then(() => {
screen = "menu"; screen = "menu";

View File

@ -1,7 +1,7 @@
{ {
"id": "runplus", "id": "runplus",
"name": "Run+", "name": "Run+",
"version": "0.26", "version": "0.27",
"description": "Displays distance, time, steps, cadence, pace and more for runners. Based on the Run app, but extended with additional screens for heart rate interval training and individual stat focus.", "description": "Displays distance, time, steps, cadence, pace and more for runners. Based on the Run app, but extended with additional screens for heart rate interval training and individual stat focus.",
"icon": "app.png", "icon": "app.png",
"tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen", "tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen",

View File

@ -17,6 +17,7 @@
B5: "step", B5: "step",
B6: "caden", B6: "caden",
paceLength: 1000, // TODO: Default to either 1km or 1mi based on locale paceLength: 1000, // TODO: Default to either 1km or 1mi based on locale
alwaysResume: false,
notify: { notify: {
dist: { dist: {
increment: 0, increment: 0,
@ -72,6 +73,13 @@
saveSettings(); saveSettings();
} }
}; };
menu[/*LANG*/"Always resume run"] = {
value : settings.alwaysResume,
onchange : v => {
settings.alwaysResume = v;
saveSettings();
},
};
var notificationsMenu = { var notificationsMenu = {
'< Back': function() { E.showMenu(menu) }, '< Back': function() { E.showMenu(menu) },
} }