diff --git a/apps/widalarmeta/widget.js b/apps/widalarmeta/widget.js index 77b7ebb88..d24b185d9 100644 --- a/apps/widalarmeta/widget.js +++ b/apps/widalarmeta/widget.js @@ -25,7 +25,7 @@ } } // getNextAlarm - function draw(fromInterval) { + function draw(_w, fromInterval) { if (this.nextAlarm === undefined) { let alarm = getNextAlarm(); if (alarm === undefined) { @@ -101,8 +101,9 @@ clearTimeout(this.timeoutId); } this.timeoutId = setTimeout(()=>{ - WIDGETS["widalarmeta"].timeoutId = undefined; - WIDGETS["widalarmeta"].draw(true); + var w = WIDGETS["widalarmeta"]; + w.timeoutId = undefined; + w.draw(w, true); }, timeout); } /* draw */ diff --git a/apps/widbatpc/widget.js b/apps/widbatpc/widget.js index b508cce8b..7ba060d6d 100644 --- a/apps/widbatpc/widget.js +++ b/apps/widbatpc/widget.js @@ -181,7 +181,7 @@ if (on) update(); }); - var id = setInterval(()=>WIDGETS["batpc"].draw(true), intervalLow); + var id = setInterval(()=>WIDGETS["batpc"].draw(WIDGETS["batpc"], true), intervalLow); WIDGETS["batpc"]={area:"tr",width:40,draw:draw,reload:reload}; setWidth(); diff --git a/apps/widmessages/widget.js b/apps/widmessages/widget.js index 44f525ec8..357ca06e3 100644 --- a/apps/widmessages/widget.js +++ b/apps/widmessages/widget.js @@ -11,7 +11,7 @@ // the name still needs to be "messages": the library calls WIDGETS["messages'].hide()/show() // see e.g. widmsggrid WIDGETS["messages"] = { - area: "tl", width: 0, srcs: [], draw: function(recall) { + area: "tl", width: 0, srcs: [], draw: function(_w, recall) { // If we had a setTimeout queued from the last time we were called, remove it if (WIDGETS["messages"].i) { clearTimeout(WIDGETS["messages"].i); @@ -42,7 +42,7 @@ this.x+12+i*24, this.y+12, {rotate: 0/*force centering*/}); } } - WIDGETS["messages"].i = setTimeout(() => WIDGETS["messages"].draw(true), 1000); + WIDGETS["messages"].i = setTimeout(() => WIDGETS["messages"].draw(WIDGETS["messages"], true), 1000); if (process.env.HWVERSION>1) Bangle.on("touch", this.touch); }, onMsg: function(type, msg) { if (this.hidden) return;