Skip to content

Commit

Permalink
fix: [ANDROAPP-6131] Add idling resource
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo <[email protected]>
  • Loading branch information
Balcan committed Jun 14, 2024
1 parent bf3f829 commit f7e21bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ fun EventListScreen(
)
val events = eventListViewModel.eventList.collectAsLazyPagingItems()
when (events.loadState.refresh) {
is LoadState.Error -> {}
is LoadState.Error -> {
EventListIdlingResourceSingleton.decrement()
}
LoadState.Loading -> {
Box(
modifier = Modifier
Expand Down Expand Up @@ -98,6 +100,7 @@ fun EventListScreen(
}
}
}
EventListIdlingResourceSingleton.decrement()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class EventListViewModel(
private var _eventList: Flow<PagingData<ListCardUiModel>> =
filterManager.asFlow(viewModelScope)
.flatMapLatest {
EventListIdlingResourceSingleton.increment()
eventRepository.filteredProgramEvents()
.map { pagingData ->
pagingData.map { event ->
Expand Down

0 comments on commit f7e21bf

Please sign in to comment.