Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chargent: fix manual/tap hiding of notification #3386

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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