fix(weatherstatus): make a difference between 'unknown weather code' and 'no weather info'

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
pull/48353/head
Julien Veyssier 2024-09-25 12:23:04 +07:00
parent bfa1c7e9ce
commit c96bde74ba
No known key found for this signature in database
GPG Key ID: 4141FEE162030638
1 changed files with 7 additions and 3 deletions

@ -293,15 +293,19 @@ export default {
return t('weather_status', 'Loading weather') return t('weather_status', 'Loading weather')
} else if (this.errorMessage) { } else if (this.errorMessage) {
return this.errorMessage return this.errorMessage
} else { } else if (this.gotWeather) {
return this.getWeatherMessage(this.weatherCode, this.temperature) return this.getWeatherMessage(this.weatherCode, this.temperature)
} else {
return t('weather_status', 'Set location for weather')
} }
}, },
forecastMessage() { forecastMessage() {
if (this.loading) { if (this.loading) {
return t('weather_status', 'Loading weather') return t('weather_status', 'Loading weather')
} else { } else if (this.gotWeather) {
return this.getWeatherMessage(this.futureWeatherCode, this.futureTemperature, true) return this.getWeatherMessage(this.futureWeatherCode, this.futureTemperature, true)
} else {
return t('weather_status', 'Set location for weather')
} }
}, },
weatherLinkTarget() { weatherLinkTarget() {
@ -535,7 +539,7 @@ export default {
this.temperatureUnit, this.temperatureUnit,
later, later,
) )
: t('weather_status', 'Set location for weather') : t('weather_status', 'Unknown weather code')
}, },
}, },
} }