diff --git a/apps/owmweather/boot.js b/apps/owmweather/boot.js index a2a880fee..82e3a280a 100644 --- a/apps/owmweather/boot.js +++ b/apps/owmweather/boot.js @@ -10,7 +10,7 @@ return settings.refresh * 1000 * 60 + 1; // +1 <- leave some slack }; - let onCompleted = function (result) { + let onCompleted = function () { loading = false; settings.updated = Date.now(); require('Storage').writeJSON("owmweather.json", settings); diff --git a/apps/owmweather/lib.js b/apps/owmweather/lib.js index d3f3d798c..b4893d484 100644 --- a/apps/owmweather/lib.js +++ b/apps/owmweather/lib.js @@ -44,7 +44,11 @@ exports.pull = function(completionCallback, errorCallback) { if (Bangle.http){ Bangle.http(uri, {timeout:10000}).then(event => { let result = parseWeather(event.resp); - if (completionCallback) completionCallback(result); + if (result === undefined) { + if (completionCallback) completionCallback(); + } else { + if (errorCallback) errorCallback(result); + } }).catch((e)=>{ if (errorCallback) errorCallback(e); });