diff --git a/src/stores/weather.js b/src/stores/weather.js index cf79fcf..0eb592e 100644 --- a/src/stores/weather.js +++ b/src/stores/weather.js @@ -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 } diff --git a/src/views/AlertsView.vue b/src/views/AlertsView.vue index 50cf491..dbafb32 100644 --- a/src/views/AlertsView.vue +++ b/src/views/AlertsView.vue @@ -1,24 +1,44 @@