From 6ba5056c960ea62408e2e12f37be7cf5e793e49e Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Fri, 24 Jan 2020 10:42:45 -0500 Subject: [PATCH 1/2] Fix regression causing 'undefined' to show up when config.hideTemp is false --- .../default/currentweather/currentweather.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index dcf771af..2f58de5b 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -195,33 +195,33 @@ Module.register("currentweather",{ var large = document.createElement("div"); large.className = "large light"; + var degreeLabel = ""; + if (this.config.units === "metric" || this.config.units === "imperial") { + degreeLabel += "°"; + } + if(this.config.degreeLabel) { + switch(this.config.units) { + case "metric": + degreeLabel += "C"; + break; + case "imperial": + degreeLabel += "F"; + break; + case "default": + degreeLabel += "K"; + break; + } + } + + if (this.config.decimalSymbol === "") { + this.config.decimalSymbol = "."; + } + if (this.config.hideTemp === true) { var weatherIcon = document.createElement("span"); weatherIcon.className = "wi weathericon " + this.weatherType; large.appendChild(weatherIcon); - var degreeLabel = ""; - if (this.config.units === "metric" || this.config.units === "imperial") { - degreeLabel += "°"; - } - if(this.config.degreeLabel) { - switch(this.config.units) { - case "metric": - degreeLabel += "C"; - break; - case "imperial": - degreeLabel += "F"; - break; - case "default": - degreeLabel += "K"; - break; - } - } - - if (this.config.decimalSymbol === "") { - this.config.decimalSymbol = "."; - } - var temperature = document.createElement("span"); temperature.className = "bright"; temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel; From a5b09d784659e2dd277c85429f8fb39e627cff99 Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Fri, 24 Jan 2020 10:50:56 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08e08d56..d036074f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Force declaration of public ip adress in config file (ISSUE #1852) - Fixes `run-start.sh`: If running in docker-container, don't check the environment, just start electron (ISSUE #1859) - Fix calendar time offset for recurring events crossing Daylight Savings Time (ISSUE #1798) +- Fix regression in currentweather module causing 'undefined' to show up when config.hideTemp is false ### Updated - Remove documentation from core repository and link to new dedicated docs site: [docs.magicmirror.builders](https://docs.magicmirror.builders).