mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 05:52:51 +02:00
Simplifies flow collection for new events.
This commit is contained in:
@@ -1197,23 +1197,21 @@ class AccountViewModel(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
Log.d("Init", "AccountViewModel")
|
Log.d("Init", "AccountViewModel")
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
collectorJob =
|
||||||
feedStates.init()
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
// awaits for init to finish before starting to capture new events.
|
feedStates.init()
|
||||||
|
// awaits for init to finish before starting to capture new events.
|
||||||
|
|
||||||
collectorJob =
|
LocalCache.live.newEventBundles.collect { newNotes ->
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
Log.d(
|
||||||
LocalCache.live.newEventBundles.collect { newNotes ->
|
"Rendering Metrics",
|
||||||
Log.d(
|
"Notification Dots Calculation refresh ${this@AccountViewModel} for ${account.userProfile().toBestDisplayName()}",
|
||||||
"Rendering Metrics",
|
)
|
||||||
"Notification Dots Calculation refresh ${this@AccountViewModel} for ${account.userProfile().toBestDisplayName()}",
|
feedStates.updateFeedsWith(newNotes)
|
||||||
)
|
invalidateInsertData(newNotes)
|
||||||
feedStates.updateFeedsWith(newNotes)
|
upgradeAttestations()
|
||||||
invalidateInsertData(newNotes)
|
|
||||||
upgradeAttestations()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCleared() {
|
override fun onCleared() {
|
||||||
|
Reference in New Issue
Block a user