From 2f6e650c1bf3f9a84771725cbc73d9bf95afb5e0 Mon Sep 17 00:00:00 2001 From: Rodrigo Ramez Norambuena Date: Wed, 26 Oct 2016 18:59:56 +0000 Subject: [PATCH] currentweather, weatherforecast: fix locationID empty Fix when the option locationID the value = '' If you have the next config config: { // See 'Configuration options' for more information. location: 'Chillan, Chile', locationID: '', appid: 'abcde12345abcde12345abcde12345ab' } The modules dont get the data, because the parameters of query is created in id='' --- modules/default/currentweather/currentweather.js | 4 ++-- modules/default/weatherforecast/weatherforecast.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 39db3f09..bc7ccbb7 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -259,9 +259,9 @@ Module.register("currentweather",{ */ getParams: function() { var params = "?"; - if(this.config.locationID !== false) { + if(this.config.locationID) { params += "id=" + this.config.locationID; - } else if(this.config.location !== false) { + } else if(this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 7f3ef71d..51c3f56e 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -249,9 +249,9 @@ Module.register("weatherforecast",{ */ getParams: function() { var params = "?"; - if(this.config.locationID !== false) { + if(this.config.locationID) { params += "id=" + this.config.locationID; - } else if(this.config.location !== false) { + } else if(this.config.location) { params += "q=" + this.config.location; } else if (this.firstEvent && this.firstEvent.geo) { params += "lat=" + this.firstEvent.geo.lat + "&lon=" + this.firstEvent.geo.lon