Fix messages ignoring "Vibrate: Off" setting (from PR #2023)
parent
0f4fc046f6
commit
d82454f942
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue