fix(city): persist full city list and re-emit dashboard context on re-selection

- Map cityList rows without coordinates; fall back en/ru/be for display names
- Replace local city cache on sync when opening city screen
- Use SharedFlow + prefs reads so re-selecting the same city (e.g. Minsk) notifies dashboard

Made-with: Cursor
This commit is contained in:
2026-04-06 22:19:42 +02:00
parent 3057d9c2d4
commit 9cbc521a0d
6 changed files with 55 additions and 16 deletions

View File

@@ -51,6 +51,7 @@ class CityViewModel @Inject constructor(
private fun loadCities() {
viewModelScope.launch(Dispatchers.IO) {
val localeLanguage = Locale.getDefault().language
cityService.syncCitiesFromRemote(localeLanguage)
val regions = cityService.getCitiesGroupedByCountry(localeLanguage)
val selectedCity = cityService.getSelectedCity()
val hasOnlyDefaultCity = regions.isEmpty()