forked from FOSS/BangleApps
#1132: Messages: Allow disabling repetition of buzzer
parent
a4c97850dd
commit
d35481130a
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "messages",
|
||||
"name": "Messages",
|
||||
"version": "0.22",
|
||||
"version": "0.21",
|
||||
"description": "App to display notifications from iOS and Gadgetbridge",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -8,11 +8,10 @@ draw:function() {
|
|||
//if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute
|
||||
let settings = require('Storage').readJSON("messages.settings.json", true) || {};
|
||||
if (settings.repeat===undefined) settings.repeat = 4;
|
||||
if(settings.repeat!==0) {
|
||||
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
|
||||
this.l = Date.now();
|
||||
WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds
|
||||
}
|
||||
if (settings.repeat===0) settings.repeat = (settings.unreadTimeout+1)*1000; // best way to no-repeat and keep next code
|
||||
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
|
||||
this.l = Date.now();
|
||||
WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds
|
||||
}
|
||||
setTimeout(()=>WIDGETS["messages"].draw(), 1000);
|
||||
if (process.env.HWVERSION>1) Bangle.on('touch', this.touch);
|
||||
|
|
Loading…
Reference in New Issue