Skip to content
Snippets Groups Projects
Commit 276dace0 authored by Kasalehlia's avatar Kasalehlia
Browse files

[weather] fixed missing cb crash

parent 8183768a
No related branches found
No related tags found
No related merge requests found
...@@ -66,11 +66,12 @@ function degToDirection(deg) { ...@@ -66,11 +66,12 @@ function degToDirection(deg) {
module.exports = function (io) { module.exports = function (io) {
var context = {}; var context = {};
var firstTime = true;
var update = function (firstUpdateCb) { var update = function (firstUpdateCb) {
var then = function () { var then = function () {
if (context.current && context.forecast) { if (context.current && context.forecast && firstTime) {
firstUpdateCb(); firstUpdateCb();
then = function () {} firstTime = false;
} }
}; };
fetchCurrent(CITYID, function (current) { fetchCurrent(CITYID, function (current) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment