Skip to content

Commit

Permalink
Merge pull request #3386 from bobrippling/fix/chargent-notify-hide
Browse files Browse the repository at this point in the history
chargent: fix manual/tap hiding of notification
  • Loading branch information
thyttan committed May 2, 2024
2 parents 2d20c81 + dcd5a2d commit 37879b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/chargent/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions apps/chargent/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion apps/chargent/metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions apps/notify/notify_bjs2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 37879b5

Please sign in to comment.