Only refreshes follow lists once per notification event.

This commit is contained in:
Vitor Pamplona
2023-06-02 21:27:43 -04:00
parent e9fd47a536
commit 8e16daaaa3
2 changed files with 2 additions and 5 deletions
@@ -1,7 +1,6 @@
package com.vitorpamplona.amethyst.ui.navigation
import android.graphics.Rect
import android.os.Looper
import android.view.ViewTreeObserver
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
@@ -371,10 +371,8 @@ class FollowListViewModel(val account: Account) : ViewModel() {
refresh()
collectorJob = viewModelScope.launch(Dispatchers.IO) {
LocalCache.live.newEventBundles.collect { newNotes ->
newNotes.forEach {
if (it.event is PeopleListEvent) {
refresh()
}
if (newNotes.any { it.event is PeopleListEvent }) {
refresh()
}
}
}