Skip to content

Commit af2f861

Browse files
authored
Fix widgets drawing w/out timeout
1 parent 7d56b7d commit af2f861

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/modclock/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ let draw = function() {
165165

166166
}
167167

168-
168+
169169
// draw the date, in a normal font
170170
g.setFont("Vector",18);
171171
g.setFontAlign(0,0); // align center bottom
172172
// pad the date - this clears the background if the date were to change length
173173
var dateStr = require("locale").dow(new Date(), 1)+", "+ require("locale").month(new Date(), true)+" "+new Date().getDate();
174174
g.drawString(" "+dateStr+" ", g.getWidth()/2, Y+9, true /*clear background*/);
175175

176-
176+
Bangle.drawWidgets();
177177

178178
// queue next draw
179179
if (drawTimeout) clearTimeout(drawTimeout);
@@ -203,5 +203,4 @@ g.clear();
203203
// Load widgets
204204
Bangle.loadWidgets();
205205
draw();
206-
setTimeout(Bangle.drawWidgets,0);
207206
}

0 commit comments

Comments
 (0)