refactor: Collect distinct loadstates to minimise churn (#1230)
This commit is contained in:
parent
9d83970c26
commit
8ad1a37991
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user