diff --git a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt index d5f891db2..6c6a63229 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt @@ -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(