diff --git a/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt b/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt index cd0a6b98..8eaaee33 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/launcher/widgets/weather/WeatherWidgetWM.kt @@ -58,6 +58,11 @@ class WeatherWidgetWM : ViewModel(), KoinComponent { dailyForecasts.postValue(value) } + val currentForecast = MutableLiveData(getCurrentlySelectedForecast()) + val dailyForecasts = MutableLiveData>(emptyList()) + val currentDayForecasts = MutableLiveData>(emptyList()) + val currentDailyForecast = MutableLiveData(null) + init { viewModelScope.launch { forecastsFlow.collectLatest { @@ -66,11 +71,6 @@ class WeatherWidgetWM : ViewModel(), KoinComponent { } } - val currentForecast = MutableLiveData(getCurrentlySelectedForecast()) - val dailyForecasts = MutableLiveData>(emptyList()) - val currentDayForecasts = MutableLiveData>(emptyList()) - val currentDailyForecast = MutableLiveData(null) - val hasLocationPermission = permissionsManager.hasPermission(PermissionGroup.Location).asLiveData() fun requestLocationPermission(context: AppCompatActivity) { permissionsManager.requestPermission(context, PermissionGroup.Location)