Update lib.js

Unlock the watch, to get touch access, if the user want that.
master
KungPhoo 2022-03-28 22:08:16 +02:00 committed by GitHub
parent a06c782ede
commit af7f672053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -58,6 +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;
if (!quiet && loadMessages && global.WIDGETS && WIDGETS.messages) if (!quiet && loadMessages && global.WIDGETS && WIDGETS.messages)
WIDGETS.messages.buzz(); WIDGETS.messages.buzz();
// after a delay load the app, to ensure we have all the messages // after a delay load the app, to ensure we have all the messages
@ -65,7 +66,12 @@ exports.pushMessage = function(event) {
exports.messageTimeout = setTimeout(function() { exports.messageTimeout = setTimeout(function() {
exports.messageTimeout = undefined; exports.messageTimeout = undefined;
// if we're in a clock or it's important, go straight to messages app // if we're in a clock or it's important, go straight to messages app
if (loadMessages) return load("messages.app.js"); if (loadMessages){
if(unlockWatch){
Bangle.setLocked(false);
}
return load("messages.app.js");
}
if (!quiet && (!global.WIDGETS || !WIDGETS.messages)) return Bangle.buzz(); // no widgets - just buzz to let someone know if (!quiet && (!global.WIDGETS || !WIDGETS.messages)) return Bangle.buzz(); // no widgets - just buzz to let someone know
WIDGETS.messages.show(); WIDGETS.messages.show();
}, 500); }, 500);