1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

weather: fix display when 0 temp

fixes #782
This commit is contained in:
bbedward
2025-11-21 17:06:57 -05:00
parent 4eb896629d
commit e22482988f

View File

@@ -37,10 +37,10 @@ BasePill {
StyledText {
text: {
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
if (temp === undefined || temp === null || temp === 0) {
if (!WeatherService.weather.available) {
return "--";
}
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
return temp;
}
font.pixelSize: Theme.barTextSize(root.barThickness)
@@ -64,11 +64,10 @@ BasePill {
StyledText {
text: {
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
if (temp === undefined || temp === null || temp === 0) {
if (!WeatherService.weather.available) {
return "--°" + (SettingsData.useFahrenheit ? "F" : "C");
}
const temp = SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp;
return temp + "°" + (SettingsData.useFahrenheit ? "F" : "C");
}
font.pixelSize: Theme.barTextSize(root.barThickness)