From cbf3775e4d0ecc696c9e71ad823226cd1c3b87f2 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Wed, 23 Apr 2025 08:36:45 +0100 Subject: [PATCH] runplus: sync exstats state with recorder (on load) --- apps/runplus/ChangeLog | 2 +- apps/runplus/app.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/runplus/ChangeLog b/apps/runplus/ChangeLog index 8c192de4f..c50ee800f 100644 --- a/apps/runplus/ChangeLog +++ b/apps/runplus/ChangeLog @@ -32,4 +32,4 @@ Write to correct settings file, fixing settings not working. 0.29: Optimise UI: only redraw if we showed a recorder menu and correctly track screen state 0.30: Change the "time" stat to show active time (duration) rather than - elapsed time (fix #3802) + elapsed time (fix #3802), and sync with recorder on load diff --git a/apps/runplus/app.js b/apps/runplus/app.js index aa2e5f0d3..a35d0cc5e 100644 --- a/apps/runplus/app.js +++ b/apps/runplus/app.js @@ -51,6 +51,11 @@ let statIDs = [settings.B1,settings.B2,settings.B3,settings.B4,settings.B5,setti let exs = ExStats.getStats(statIDs, settings); // --------------------------- +// handle the case where we were stopped outside of the app +if(exs.state.active && settings.record && require("recorder") && !require("recorder").isRecording()){ + exs.stop(); +} + function setStatus(running) { layout.button.label = running ? "STOP" : "START"; layout.status.label = running ? "RUN" : "STOP";