chargent: guard against exceptions in `onHide()`

master
Rob Pilling 2024-04-27 16:25:03 +01:00
parent 7a3e0d2e7e
commit 09963e92e8
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@
lim = sum / cnt;
require('Storage').writeJSON('chargent.json', {limit: lim});
}
const onHide = () => { id = clearInterval(id) };
const onHide = () => { if(id) id = clearInterval(id) };
require('notify').show({id: 'chargent', title: 'Fully charged', onHide });
// TODO ? customizable
Bangle.buzz(500);