Browse Source

Cleanup js

Florian Hoss 2 years ago
parent
commit
c9fb684d0a
1 changed files with 1 additions and 2 deletions
  1. 1 2
      static/js/app.js

+ 1 - 2
static/js/app.js

@@ -11,8 +11,7 @@ const weatherSunset = document.getElementById("weatherSunset");
 socket.onmessage = (event) => {
   const parsed = JSON.parse(event.data);
   if (parsed.ws_type === WsType.Weather) {
-    const weather = parsed.message;
-    weatherIcon.setAttribute("xlink:href", "#" + weather.weather[0].icon);
+    weatherIcon.setAttribute("xlink:href", "#" + parsed.message.weather[0].icon);
     weatherTemp.innerHTML = parsed.message.main.temp + " " + parsed.message.units;
     weatherDescription.innerHTML = parsed.message.weather[0].description;
     weatherHumidity.innerHTML = parsed.message.main.humidity + "%";