Add refresh buttons to weather data pages

This commit is contained in:
Lance Edgar 2024-06-09 16:27:04 -05:00
parent 7a14101e01
commit a1f84465cc
4 changed files with 106 additions and 43 deletions

View file

@ -26,9 +26,11 @@ export const useWeatherStore = defineStore('weather', {
actions: {
clearWeather() {
this.setCoordinates(null)
this.setCityState(null)
clearWeather(keepCoordinates) {
if (!keepCoordinates) {
this.setCoordinates(null)
this.setCityState(null)
}
this.setWeather(null)
this.setForecast(null)
this.radarLatestURL = null
@ -103,10 +105,10 @@ export const useWeatherStore = defineStore('weather', {
// put "likely" before "possible" alerts
newAlerts.features.sort((a, b) => {
if (a.properties.certainty == 'Likely' && b.properties.certainty == 'Possible') {
if (a.properties.certainty == 'Likely' && b.properties.certainty != 'Likely') {
return -1
}
if (a.properties.certainty == 'Possible' && b.properties.certainty == 'Likely') {
if (a.properties.certainty != 'Likely' && b.properties.certainty == 'Likely') {
return 1
}