From 276dace044f62ce7b42e4dc97ffbca3e6d031a98 Mon Sep 17 00:00:00 2001 From: Kasalehlia <kasalehlia@clonejo.de> Date: Tue, 17 Nov 2015 21:54:32 +0100 Subject: [PATCH] [weather] fixed missing cb crash --- modules/weather.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/weather.js b/modules/weather.js index db8ce35..542e9a0 100644 --- a/modules/weather.js +++ b/modules/weather.js @@ -66,11 +66,12 @@ function degToDirection(deg) { module.exports = function (io) { var context = {}; + var firstTime = true; var update = function (firstUpdateCb) { var then = function () { - if (context.current && context.forecast) { + if (context.current && context.forecast && firstTime) { firstUpdateCb(); - then = function () {} + firstTime = false; } }; fetchCurrent(CITYID, function (current) { -- GitLab