Ensure the snackbar "No more media to show" is not render after the app is loading the first item. Closes #4345

This commit is contained in:
Benoit Marty
2025-03-12 12:09:51 +01:00
parent 3112243a8a
commit 6958cc480b

View File

@@ -164,7 +164,9 @@ class MediaViewerPresenter @AssistedInject constructor(
) {
val isRenderingLoadingBackward by remember {
derivedStateOf {
currentIndex.intValue == data.value.lastIndex && data.value.lastOrNull() is MediaViewerPageData.Loading
currentIndex.intValue == data.value.lastIndex &&
data.value.size > 1 &&
data.value.lastOrNull() is MediaViewerPageData.Loading
}
}
if (isRenderingLoadingBackward) {
@@ -186,7 +188,9 @@ class MediaViewerPresenter @AssistedInject constructor(
) {
val isRenderingLoadingForward by remember {
derivedStateOf {
currentIndex.intValue == 0 && data.value.firstOrNull() is MediaViewerPageData.Loading
currentIndex.intValue == 0 &&
data.value.size > 1 &&
data.value.firstOrNull() is MediaViewerPageData.Loading
}
}
if (isRenderingLoadingForward) {