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.04: Added notification
|
||||||
0.05: Fixed boot
|
0.05: Fixed boot
|
||||||
0.06: Allow tap to silence notification/buzzing
|
0.06: Allow tap to silence notification/buzzing
|
||||||
|
0.07: Fix notification-tap silencing and notification length
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
lim = sum / cnt;
|
lim = sum / cnt;
|
||||||
require('Storage').writeJSON('chargent.json', {limit: lim});
|
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 });
|
require('notify').show({id: 'chargent', title: 'Charged', onHide });
|
||||||
// TODO ? customizable
|
// TODO ? customizable
|
||||||
Bangle.buzz(500);
|
Bangle.buzz(500);
|
||||||
setTimeout(() => Bangle.buzz(500), 1000);
|
setTimeout(() => Bangle.buzz(500), 1000);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ "id": "chargent",
|
{ "id": "chargent",
|
||||||
"name": "Charge Gently",
|
"name": "Charge Gently",
|
||||||
"version": "0.06",
|
"version": "0.07",
|
||||||
"description": "When charging, reminds you to disconnect the watch to prolong battery life.",
|
"description": "When charging, reminds you to disconnect the watch to prolong battery life.",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
|
@ -157,6 +157,7 @@ exports.hide = function(options) {
|
||||||
hideCallback = undefined;
|
hideCallback = undefined;
|
||||||
id = null;
|
id = null;
|
||||||
Bangle.removeListener("touch", exports.hide);
|
Bangle.removeListener("touch", exports.hide);
|
||||||
|
E.stopEventPropagation && E.stopEventPropagation();
|
||||||
function anim() {
|
function anim() {
|
||||||
pos += 4;
|
pos += 4;
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
|
|
Loading…
Reference in New Issue