refactor: Collect distinct loadstates to minimise churn (#1230)

This commit is contained in:
Nik Clayton 2025-01-24 17:40:15 +01:00 committed by GitHub
parent 9d83970c26
commit 8ad1a37991
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ class NotificationsFragment :
}
// Update the UI from the loadState
adapter.loadStateFlow.collect { loadState ->
adapter.loadStateFlow.distinctUntilChangedBy { it.refresh }.collect { loadState ->
when (loadState.refresh) {
is LoadState.Error -> {
binding.progressIndicator.hide()

View File

@ -251,7 +251,7 @@ class TimelineFragment :
}
}
adapter.loadStateFlow.collect { loadState ->
adapter.loadStateFlow.distinctUntilChangedBy { it.refresh }.collect { loadState ->
when (loadState.refresh) {
is LoadState.Error -> {
binding.progressIndicator.hide()