From 1a3c94579d38018c5c0811eb56dea3e8e6df69d0 Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Wed, 24 Jul 2024 14:15:32 +0200 Subject: [PATCH] fix setting icon based on weather code --- apps/ffcniftyapp/app.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/ffcniftyapp/app.js b/apps/ffcniftyapp/app.js index 517c0e2c5..4a11caca6 100644 --- a/apps/ffcniftyapp/app.js +++ b/apps/ffcniftyapp/app.js @@ -171,15 +171,14 @@ const clock = new ClockFace({ let cTemp= (curr === "no data" ? 273 : curr.temp); // const temp = locale.temp(curr.temp - 273.15).match(/^(\D*\d*)(.*)$/); - if (locale == "en" || locale == "en_GB" || locale == "en_US") { - let w_icon = chooseIcon(curr.txt === undefined ? "no data" : curr.txt); + let w_icon = getErr; + if (locale.name === "en" || locale.name === "en_GB" || locale.name === "en_US") { + w_icon = chooseIcon(curr.txt === undefined ? "no data" : curr.txt); } else { - // cannot use condition string to determine icon of language is not English; use weather code instead + // cannot use condition string to determine icon of language is not English; use weather code instead const code = curr.code || -1; if (code > 0) { - let w_icon = chooseIconByCode(curr.code); - } else { - let w_icon = getErr(); + w_icon = chooseIconByCode(curr.code); } }