BugFix for not updating Notifications quickly.

This commit is contained in:
Vitor Pamplona
2023-06-19 20:30:13 -04:00
parent f937e95b35
commit b271c1775c
2 changed files with 15 additions and 2 deletions
@@ -283,6 +283,20 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
}
}
@OptIn(ExperimentalTime::class)
fun invalidateDataAndSendToTop() {
clear()
bundler.invalidate(false) {
// adds the time to perform the refresh into this delay
// holding off new updates in case of heavy refresh routines.
val (value, elapsed) = measureTimedValue {
refreshSuspended()
sendToTop()
}
Log.d("Time", "${this.javaClass.simpleName} Card update $elapsed")
}
}
@OptIn(ExperimentalTime::class)
fun checkKeysInvalidateDataAndSendToTop() {
if (lastFeedKey != localFilter.feedKey()) {
@@ -141,8 +141,7 @@ fun MainScreen(accountViewModel: AccountViewModel, accountStateViewModel: Accoun
videoFeedViewModel.sendToTop()
}
Route.Notification.base -> {
notifFeedViewModel.clear()
notifFeedViewModel.sendToTop()
notifFeedViewModel.invalidateDataAndSendToTop()
}
}