Fixed night weather icons.

This commit is contained in:
Jas Singh
2024-07-03 00:32:27 -07:00
parent 2a0be05a2b
commit f0366f3186
3 changed files with 19 additions and 7 deletions

View File

@@ -98,12 +98,15 @@ const WeatherWidget = () => {
Widget.Icon({
class_name: "calendar-menu-weather today icon",
icon: theWeather.bind("value").as((v) => {
return icons.weather[
v.current.condition.text
let iconQuery = v.current.condition.text
.trim()
.toLowerCase()
.replaceAll(" ", "_")
];
if (!v.current.isDay && iconQuery === "partly_cloudy") {
iconQuery = "partly_cloudy_night";
}
return icons.weather[iconQuery];
}),
}),
],
@@ -275,12 +278,16 @@ const WeatherWidget = () => {
(h) => h.time_epoch === nextEpoch,
);
return icons.weather[
weatherAtEpoch?.condition.text
let iconQuery = weatherAtEpoch?.condition.text
.trim()
.toLowerCase()
.replaceAll(" ", "_")
];
if (!weatherAtEpoch?.isDay && iconQuery === "partly_cloudy") {
iconQuery = "partly_cloudy_night";
}
return icons.weather[iconQuery];
}),
}),
Widget.Label({

View File

@@ -34,7 +34,11 @@ const Media = () => {
)[0];
}
if (media.players.length && curPlayer && curPlayer.play_back_status !== "Stopped") {
if (
media.players.length &&
curPlayer &&
curPlayer.play_back_status !== "Stopped"
) {
return (self.children = [
AlbumCover(curPlayer),
Widget.Box({