mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-02 08:58:23 +02:00
Simplifies flow collection for new events.
This commit is contained in:
parent
66ed26dcea
commit
7b8c7a1a78
@ -1197,23 +1197,21 @@ class AccountViewModel(
|
||||
|
||||
init {
|
||||
Log.d("Init", "AccountViewModel")
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
feedStates.init()
|
||||
// awaits for init to finish before starting to capture new events.
|
||||
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",
|
||||
"Notification Dots Calculation refresh ${this@AccountViewModel} for ${account.userProfile().toBestDisplayName()}",
|
||||
)
|
||||
feedStates.updateFeedsWith(newNotes)
|
||||
invalidateInsertData(newNotes)
|
||||
upgradeAttestations()
|
||||
}
|
||||
LocalCache.live.newEventBundles.collect { newNotes ->
|
||||
Log.d(
|
||||
"Rendering Metrics",
|
||||
"Notification Dots Calculation refresh ${this@AccountViewModel} for ${account.userProfile().toBestDisplayName()}",
|
||||
)
|
||||
feedStates.updateFeedsWith(newNotes)
|
||||
invalidateInsertData(newNotes)
|
||||
upgradeAttestations()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user