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) {