mirror of https://github.com/espruino/BangleApps
#1132: Messages: Allow disabling repetition of buzzer: Wow, dazzling solution
parent
7c0328d642
commit
f20872f6ae
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "messages",
|
||||
"name": "Messages",
|
||||
"version": "0.55",
|
||||
"version": "0.43",
|
||||
"description": "App to display notifications from iOS and Gadgetbridge/Android",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -6,10 +6,9 @@ draw:function() {
|
|||
g.reset().clearRect(this.x, this.y, this.x+this.width, this.y+this.iconwidth);
|
||||
g.drawImage((c&1) ? atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+DAADDAADDAADDwAPD8A/DOBzDDn/DA//DAHvDAPvjAPvjAPvjAPvh///gf/vAAD+AAB8AAAAA==") : atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+D///D///A//8CP/xDj/HD48DD+B8D/D+D/3vD/vvj/vvj/vvj/vvh/v/gfnvAAD+AAB8AAAAA=="), this.x, this.y);
|
||||
let settings = require('Storage').readJSON("messages.settings.json", true) || {};
|
||||
console.log("dingen ", typeof(settings.repeat), settings.repeat)
|
||||
if (settings.repeat===undefined) settings.repeat = 4;
|
||||
if(settings.repeat===0) {
|
||||
if(c===1) WIDGETS["messages"].buzz(); // buzz just once
|
||||
} else if (c<settings.maxUnreadTimeout && (Date.now()-this.l)>settings.repeat*1000) {
|
||||
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
|
||||
this.l = Date.now();
|
||||
WIDGETS["messages"].buzz(); // buzz every 4 seconds
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue