Improve code clarity

This commit is contained in:
Benoit Marty 2025-01-23 15:43:33 +01:00
parent 05660fbc18
commit 4d2edfaccd

View file

@ -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)