Fix empty layout not appearing in browse source screen in some cases (#2043)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> (cherry picked from commit 37e19edf8a5f6a15a95f160390cbcf22d8133380) # Conflicts: # CHANGELOG.md # app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt
This commit is contained in:
parent
afe326006f
commit
2a845bd7b5
@ -82,10 +82,18 @@ fun BrowseSourceContent(
|
||||
}
|
||||
}
|
||||
|
||||
if (mangaList.itemCount <= 0 && errorState != null && errorState is LoadState.Error) {
|
||||
if (mangaList.itemCount == 0 && mangaList.loadState.refresh is LoadState.Loading) {
|
||||
LoadingScreen(Modifier.padding(contentPadding))
|
||||
return
|
||||
}
|
||||
|
||||
if (mangaList.itemCount == 0) {
|
||||
EmptyScreen(
|
||||
modifier = Modifier.padding(contentPadding),
|
||||
message = getErrorMessage(errorState),
|
||||
message = when (errorState) {
|
||||
is LoadState.Error -> getErrorMessage(errorState)
|
||||
else -> stringResource(MR.strings.no_results_found)
|
||||
},
|
||||
actions = if (source is LocalSource /* SY --> */ && onLocalSourceHelpClick != null /* SY <-- */) {
|
||||
persistentListOf(
|
||||
EmptyScreenAction(
|
||||
@ -104,7 +112,7 @@ fun BrowseSourceContent(
|
||||
// SY -->
|
||||
if (onWebViewClick != null) {
|
||||
EmptyScreenAction(
|
||||
MR.strings.action_open_in_web_view,
|
||||
stringRes = MR.strings.action_open_in_web_view,
|
||||
icon = Icons.Outlined.Public,
|
||||
onClick = onWebViewClick,
|
||||
)
|
||||
@ -113,7 +121,7 @@ fun BrowseSourceContent(
|
||||
},
|
||||
if (onHelpClick != null) {
|
||||
EmptyScreenAction(
|
||||
MR.strings.label_help,
|
||||
stringRes = MR.strings.label_help,
|
||||
icon = Icons.AutoMirrored.Outlined.HelpOutline,
|
||||
onClick = onHelpClick,
|
||||
)
|
||||
@ -128,13 +136,6 @@ fun BrowseSourceContent(
|
||||
return
|
||||
}
|
||||
|
||||
if (mangaList.itemCount == 0 && mangaList.loadState.refresh is LoadState.Loading) {
|
||||
LoadingScreen(
|
||||
modifier = Modifier.padding(contentPadding),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// SY -->
|
||||
if (source?.isEhBasedSource() == true && ehentaiBrowseDisplayMode) {
|
||||
BrowseSourceEHentaiList(
|
||||
|
Loading…
x
Reference in New Issue
Block a user