runplus: factor out to `setScreen`

pull/3419/head
Rob Pilling 2024-05-14 22:28:15 +01:00
parent 8bc3b49e80
commit 84730da57a
1 changed files with 6 additions and 2 deletions

View File

@ -192,11 +192,15 @@ run();
function karvonen(){
// stop updating and drawing the traditional run app UI
setScreen("karvonen");
require("runplus_karvonen").start(settings.HRM, exs.stats.bpm);
}
function setScreen(to) {
if (runInterval) clearInterval(runInterval);
runInterval = undefined;
g.reset().clearRect(Bangle.appRect);
require("runplus_karvonen").start(settings.HRM, exs.stats.bpm);
screen = "karvonen";
screen = to;
}
// Define the function to go back and forth between the different UI's