Skip to content

Commit ebb2f7d

Browse files
committed
remove fast-load and layout.setUI to so launcher load works again
1 parent 9dec064 commit ebb2f7d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

apps/dsky_clock/app.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var layout = new Layout(
5757
lazy:true});
5858
layout.update();
5959

60-
//support functions
60+
//support functioe_ns
6161

6262
function getWeather() {
6363
var weather = {};
@@ -213,7 +213,7 @@ function drawMain(){
213213
setLight('L5','ALARM',isAlarmSet(),Light_warn);
214214
setLight('L6','STEP',(getSteps()>=getStepGoal()),'#0a0');
215215

216-
layout.setUI();
216+
// layout.setUI();
217217
layout.forgetLazyState();
218218
layout.render();
219219
queueDraw();
@@ -277,12 +277,20 @@ function mode_HRM() {
277277

278278
function mode_weather() {
279279
let weather=getWeather();
280-
weather.temp = Math.round(weather.temp-273.15);
281-
setDATA('R1',weather.temp);
282-
setDATA('R2',weather.hum);
283-
setDATA('R3',weather.code);
284-
setWORD('NOUN',weather.hum);
285-
setWORD('VERB',weather.rain);
280+
try {
281+
weather.temp = Math.round(weather.temp-273.15);
282+
setDATA('R1',weather.temp);
283+
setDATA('R2',weather.hum);
284+
setDATA('R3',weather.code);
285+
setWORD('NOUN',weather.hum);
286+
setWORD('VERB',weather.rain);
287+
} catch(e) {
288+
setDATA('R1','-----');
289+
setDATA('R2','-----');
290+
setDATA('R3','-----');
291+
setDATA('R1','--');
292+
setDATA('R1','--');
293+
}
286294
}
287295

288296
function mode_compass() {
@@ -338,6 +346,12 @@ function queueDraw() {
338346
}, 60000 - (Date.now() % 60000));
339347
}
340348

349+
// Show launcher when middle button pressed
350+
Bangle.setUI("clock");
351+
352+
Bangle.loadWidgets();
353+
require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe
354+
341355
Bangle.on('lock',on=>{
342356
mode = 0;
343357
drawMain(); // draw immediately
@@ -361,18 +375,4 @@ Bangle.on('swipe', function(directionLR) {
361375

362376
g.clear();
363377
draw_bg();
364-
365-
// Show launcher when middle button pressed
366-
Bangle.setUI({
367-
mode : "clock",
368-
remove : function() {
369-
if (drawTimeout) clearTimeout(drawTimeout);
370-
if (AltDrawTimer) clearTimeout(AltDrawTimer);
371-
drawTimeout = undefined;
372-
AltDrawTimer = undefined;
373-
require("widget_utils").show(); // re-show widgets
374-
}});
375-
Bangle.loadWidgets();
376-
require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe
377-
378378
drawMain();

0 commit comments

Comments
 (0)