Skip to content

Commit

Permalink
Improve code clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jan 23, 2025
1 parent 05660fb commit 4d2edfa
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private fun MediaGalleryPage(
if (groupedMediaItems.isLoadingItems(mode)) {
// Need to trigger a pagination now if there is only one LoadingIndicator.
val loadingItem = groupedMediaItems.dataOrNull()?.getItems(mode)?.singleOrNull() as? MediaItem.LoadingIndicator
loadingItem?.let { item ->
LaunchedEffect(item.timestamp) {
state.eventSink(MediaGalleryEvents.LoadMore(item.direction))
if (loadingItem != null) {
LaunchedEffect(loadingItem.timestamp) {
state.eventSink(MediaGalleryEvents.LoadMore(loadingItem.direction))
}
}
LoadingContent(mode)
Expand Down

0 comments on commit 4d2edfa

Please sign in to comment.