mirror of https://github.com/espruino/BangleApps
parent
85a0c4100d
commit
b5e6634004
|
@ -58,7 +58,7 @@ exports.pushMessage = function(event) {
|
||||||
var loadMessages = Bangle.CLOCK || event.important;
|
var loadMessages = Bangle.CLOCK || event.important;
|
||||||
// first, buzz
|
// first, buzz
|
||||||
var quiet = (require('Storage').readJSON('setting.json',1)||{}).quiet;
|
var quiet = (require('Storage').readJSON('setting.json',1)||{}).quiet;
|
||||||
var unlockWatch = (require('Storage').readJSON('setting.json',1)||{}).unlockWatch;
|
var unlockWatch = (require('Storage').readJSON('messages.setting.json',1)||{}).unlockWatch;
|
||||||
if (!quiet && loadMessages && global.WIDGETS && WIDGETS.messages){
|
if (!quiet && loadMessages && global.WIDGETS && WIDGETS.messages){
|
||||||
WIDGETS.messages.buzz();
|
WIDGETS.messages.buzz();
|
||||||
if(unlockWatch != false){
|
if(unlockWatch != false){
|
||||||
|
|
|
@ -17,13 +17,16 @@ WIDGETS.bluetooth_notify = {
|
||||||
},
|
},
|
||||||
disconnect: function() {
|
disconnect: function() {
|
||||||
if(WIDGETS.bluetooth_notify.warningEnabled == 1){
|
if(WIDGETS.bluetooth_notify.warningEnabled == 1){
|
||||||
Bangle.buzz(700, 1); // buzz on connection loss
|
|
||||||
|
|
||||||
E.showMessage(/*LANG*/'Connection\nlost.', 'Bluetooth');
|
E.showMessage(/*LANG*/'Connection\nlost.', 'Bluetooth');
|
||||||
// setInterval(()=>{load();}, 3000); // clear message - this will reload the widget, resetting 'warningEnabled'.
|
// setInterval(()=>{load();}, 3000); // clear message - this will reload the widget, resetting 'warningEnabled'.
|
||||||
|
|
||||||
WIDGETS.bluetooth_notify.warningEnabled = 0;
|
WIDGETS.bluetooth_notify.warningEnabled = 0;
|
||||||
setTimeout('WIDGETS.bluetooth_notify.warningEnabled = 1;', 30000); // re-notify only after 30 seconds.
|
setTimeout('WIDGETS.bluetooth_notify.warningEnabled = 1;', 30000); // re-notify only after 30 seconds.
|
||||||
|
|
||||||
|
var quiet = (require('Storage').readJSON('setting.json',1)||{}).quiet;
|
||||||
|
if(!quiet){
|
||||||
|
Bangle.buzz(700, 1); // buzz on connection loss
|
||||||
|
}
|
||||||
}
|
}
|
||||||
WIDGETS.bluetooth_notify.draw();
|
WIDGETS.bluetooth_notify.draw();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue