Skip to content

Commit

Permalink
Fix messages ignoring "Vibrate: Off" setting (from PR #2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
myxor committed Jul 6, 2022
1 parent 0f4fc04 commit d82454f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/messages/ChangeLog
Expand Up @@ -55,3 +55,4 @@
0.40: Use default Bangle formatter for booleans
0.41: Add notification icons in the widget
0.42: Separate buzz pattern for incoming calls
Fix messages ignoring "Vibrate: Off" setting
7 changes: 5 additions & 2 deletions apps/messages/widget.js
Expand Up @@ -62,12 +62,15 @@ draw:function(recall) {
Bangle.drawWidgets();
},buzz:function(msgSrc) {
if ((require('Storage').readJSON('setting.json',1)||{}).quiet) return; // never buzz during Quiet Mode
var pattern;
if (msgSrc != undefined && msgSrc.toLowerCase() == "phone") {
// special vibration pattern for incoming calls
require("buzz").pattern((require('Storage').readJSON("messages.settings.json", true) || {}).vibrateCalls || ":");
pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrateCalls;
} else {
require("buzz").pattern((require('Storage').readJSON("messages.settings.json", true) || {}).vibrate || ":");
pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrate;
}
if (pattern === undefined) { pattern = ":"; } // pattern may be "", so we can't use || ":" here
require("buzz").pattern(pattern);
},touch:function(b,c) {
var w=WIDGETS["messages"];
if (!w||!w.width||c.x<w.x||c.x>w.x+w.width||c.y<w.y||c.y>w.y+w.iconwidth) return;
Expand Down

0 comments on commit d82454f

Please sign in to comment.