From de0692bba61b50eefc6724a7ef8373c6d5e8683d Mon Sep 17 00:00:00 2001 From: Nebojsa Vuksic Date: Thu, 7 Aug 2025 10:40:27 +0200 Subject: [PATCH] Only reload weather data for location if the location weather forecast isn't already previewed --- .../template/weatherApp/services/WeatherAppViewModel.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt index da469b5..babf71e 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/services/WeatherAppViewModel.kt @@ -92,7 +92,9 @@ class WeatherAppViewModel( selectedLocationIndex.value = myLocations.value.lastIndex } - onReloadWeatherForecast() + if (_weatherForecast.value.location != locationToAdd) { + onReloadWeatherForecast() + } } override fun onDeleteLocation(locationToDelete: Location) {