Alexandru Gheorghe
09/13/2024, 10:27 AMonRefresh
with a PullToRefresh LazyColumn. The "problem" is that, I'm dependent on location of the device which I extract by using coroutines (in an overall coroutineScope.launch { }
block. When first loading the app (cold start), the location is not written in DataStore, therefore it leads to the values being null and Compose finishes composing with those values (despite coroutines having been launched). I know that is the whole idea of coroutines: to not wait for them & block for async programming, though, how can I ensure I get my location data before I finish composing the screen and showing to the user the data? The onRefresh
coroutine block is executed always when the app is started as isRefreshing
is always set to true so it's equivalent to a LaunchedEffect(key1 = true)
.Alexandru Gheorghe
09/13/2024, 10:30 AMuli
09/13/2024, 12:20 PMAlexandru Gheorghe
09/13/2024, 12:23 PMuli
09/13/2024, 12:24 PMuli
09/13/2024, 12:24 PM