Revert "Revert "exstats: fix steps being negative""

pull/3414/head
Gordon Williams 2024-05-13 09:49:52 +01:00 committed by GitHub
parent cd79303f54
commit ea03c34099
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 3 deletions

View File

@ -17,3 +17,4 @@
0.16: Added ability to resume a run that was stopped previously (fix #1907) 0.16: Added ability to resume a run that was stopped previously (fix #1907)
0.17: Ensure screen redraws after "Resume run?" menu (#3044) 0.17: Ensure screen redraws after "Resume run?" menu (#3044)
0.18: Minor code improvements 0.18: Minor code improvements
0.19: Fix step count bug when runs are resumed after a long time

View File

@ -1,6 +1,6 @@
{ "id": "run", { "id": "run",
"name": "Run", "name": "Run",
"version": "0.18", "version": "0.19",
"description": "Displays distance, time, steps, cadence, pace and more for runners.", "description": "Displays distance, time, steps, cadence, pace and more for runners.",
"icon": "app.png", "icon": "app.png",
"tags": "run,running,fitness,outdoors,gps", "tags": "run,running,fitness,outdoors,gps",

View File

@ -24,4 +24,5 @@ Write to correct settings file, fixing settings not working.
0.21: Rebase on "Run" app ver. 0.16. 0.21: Rebase on "Run" app ver. 0.16.
0.22: Ensure screen redraws after "Resume run?" menu (#3044) 0.22: Ensure screen redraws after "Resume run?" menu (#3044)
0.23: Minor code improvements 0.23: Minor code improvements
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

View File

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

View File

@ -102,6 +102,7 @@ var stats = {};
const DATA_FILE = "exstats.json"; const DATA_FILE = "exstats.json";
// Load the state from a saved file if there was one // Load the state from a saved file if there was one
state = Object.assign(state, require("Storage").readJSON(DATA_FILE,1)||{}); state = Object.assign(state, require("Storage").readJSON(DATA_FILE,1)||{});
state.startSteps = Bangle.getStepCount() - (state.lastSteps - state.startSteps);
// force step history to a uint8array // force step history to a uint8array
state.stepHistory = new Uint8Array(state.stepHistory); state.stepHistory = new Uint8Array(state.stepHistory);
// when we exit, write the current state // when we exit, write the current state