Simplifies flow collection for new events.

This commit is contained in:
Vitor Pamplona
2024-08-26 18:22:12 -04:00
parent 66ed26dcea
commit 7b8c7a1a78

View File

@@ -1197,12 +1197,11 @@ class AccountViewModel(
init {
Log.d("Init", "AccountViewModel")
collectorJob =
viewModelScope.launch(Dispatchers.Default) {
feedStates.init()
// awaits for init to finish before starting to capture new events.
collectorJob =
viewModelScope.launch(Dispatchers.IO) {
LocalCache.live.newEventBundles.collect { newNotes ->
Log.d(
"Rendering Metrics",
@@ -1214,7 +1213,6 @@ class AccountViewModel(
}
}
}
}
override fun onCleared() {
Log.d("Init", "AccountViewModel onCleared")