mirror of https://github.com/espruino/BangleApps
Merge pull request #3386 from bobrippling/fix/chargent-notify-hide
chargent: fix manual/tap hiding of notificationpull/3397/head
commit
37879b57bd
|
@ -4,3 +4,4 @@
|
|||
0.04: Added notification
|
||||
0.05: Fixed boot
|
||||
0.06: Allow tap to silence notification/buzzing
|
||||
0.07: Fix notification-tap silencing and notification length
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
lim = sum / cnt;
|
||||
require('Storage').writeJSON('chargent.json', {limit: lim});
|
||||
}
|
||||
const onHide = () => { id = clearInterval(id) };
|
||||
require('notify').show({id: 'chargent', title: 'Fully charged', onHide });
|
||||
const onHide = () => { if(id) id = clearInterval(id) };
|
||||
require('notify').show({id: 'chargent', title: 'Charged', onHide });
|
||||
// TODO ? customizable
|
||||
Bangle.buzz(500);
|
||||
setTimeout(() => Bangle.buzz(500), 1000);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "chargent",
|
||||
"name": "Charge Gently",
|
||||
"version": "0.06",
|
||||
"version": "0.07",
|
||||
"description": "When charging, reminds you to disconnect the watch to prolong battery life.",
|
||||
"icon": "icon.png",
|
||||
"type": "bootloader",
|
||||
|
|
|
@ -157,6 +157,7 @@ exports.hide = function(options) {
|
|||
hideCallback = undefined;
|
||||
id = null;
|
||||
Bangle.removeListener("touch", exports.hide);
|
||||
E.stopEventPropagation && E.stopEventPropagation();
|
||||
function anim() {
|
||||
pos += 4;
|
||||
if (pos > 0) {
|
||||
|
|
Loading…
Reference in New Issue