override fun onLocationSelected()

in src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/WeatherAppViewModel.kt [270:277]


    override fun onLocationSelected(selectedLocationIndex: Int) {
        val newState = _myLocationsUIStateFlow.value.withItemAtIndexSelected(selectedLocationIndex)
        updateLocationsUIStateWith(newState)

        if (_weatherState.value.getLocationOrNull() != newState.selectedLocation) {
            onReloadWeatherForecast()
        }
    }