1
0
Fork 0

bikespeedo: check recorder widget each press

master
Rob Pilling 2023-05-25 21:04:29 +01:00
parent 12e6e4b2b0
commit cca9906f85
1 changed files with 14 additions and 13 deletions

View File

@ -536,19 +536,20 @@ if (cfg.record && WIDGETS["recorder"]) {
if (cfg.recordStopOnExit)
E.on('kill', () => WIDGETS["recorder"].setRecording(false));
Bangle.setUI(
"custom",
() => {
const wid = WIDGETS["recorder"];
const active = wid.isRecording();
if(active)
wid.setRecording(false);
else
wid.setRecording(true, { force: "append" });
},
);
} else {
start();
}
Bangle.setUI({
mode: "custom",
btn: () => {
const rec = WIDGETS["recorder"];
if(!rec) return;
const active = rec.isRecording();
if(active)
rec.setRecording(false);
else
rec.setRecording(true, { force: "append" });
},
});