Merge pull request #3418 from bobrippling/fix/multitimer-uiremove

multitimer: preserve original `uiRemove`
pull/3390/head
Rob Pilling 2024-05-16 08:54:30 +01:00 committed by GitHub
commit a4c5e14ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View File

@ -10,3 +10,4 @@
0.09: Minor code improvements
0.10: Handle missing alarm data, e.g. when our reset is fired from
non-multitimer alarms
0.11: Preserve setUI removal callbacks, e.g. those of showMenu

View File

@ -691,10 +691,12 @@ function setUI() {
// E.showMenu/E.showScroller/E.showAlert call setUI, so we register onDrag() separately
// and tack on uiRemove after the fact to avoid interfering
Bangle.on("drag", onDrag);
const origRemove = Bangle.uiRemove;
Bangle.uiRemove = () => {
Bangle.removeListener("drag", onDrag);
Object.values(timerInt1).forEach(clearTimeout);
Object.values(timerInt2).forEach(clearTimeout);
if (origRemove) origRemove();
};
}

View File

@ -1,7 +1,7 @@
{
"id": "multitimer",
"name": "Multi Timer",
"version": "0.10",
"version": "0.11",
"description": "Set timers and chronographs (stopwatches) and watch them count down in real time. Pause, create, edit, and delete timers and chronos, and add custom labels/messages. Also sets alarms.",
"icon": "app.png",
"screenshots": [