mirror of https://github.com/espruino/BangleApps
Merge pull request #3431 from bobrippling/feat/run-noprompt
runplus: add option to always resumepull/3446/head
commit
946d72205c
|
@ -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.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.27: Allow setting to alway resume an activity
|
||||
|
|
|
@ -26,6 +26,7 @@ let settings = Object.assign({
|
|||
B5: "step",
|
||||
B6: "caden",
|
||||
paceLength: 1000,
|
||||
alwaysResume: false,
|
||||
notify: {
|
||||
dist: {
|
||||
value: 0,
|
||||
|
@ -64,10 +65,10 @@ function onStartStop() {
|
|||
}
|
||||
|
||||
var running = !exs.state.active;
|
||||
var shouldResume = false;
|
||||
var shouldResume = settings.alwaysResume;
|
||||
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.
|
||||
then(() => {
|
||||
screen = "menu";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "runplus",
|
||||
"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.",
|
||||
"icon": "app.png",
|
||||
"tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen",
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
B5: "step",
|
||||
B6: "caden",
|
||||
paceLength: 1000, // TODO: Default to either 1km or 1mi based on locale
|
||||
alwaysResume: false,
|
||||
notify: {
|
||||
dist: {
|
||||
increment: 0,
|
||||
|
@ -72,6 +73,13 @@
|
|||
saveSettings();
|
||||
}
|
||||
};
|
||||
menu[/*LANG*/"Always resume run"] = {
|
||||
value : settings.alwaysResume,
|
||||
onchange : v => {
|
||||
settings.alwaysResume = v;
|
||||
saveSettings();
|
||||
},
|
||||
};
|
||||
var notificationsMenu = {
|
||||
'< Back': function() { E.showMenu(menu) },
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue