Show proper string in manga detail screen for SourceNotInstalledException

(cherry picked from commit 14d1bcacc9cba0e14cdf90a7972bf85660465c0b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
This commit is contained in:
arkon 2023-03-19 17:23:51 -04:00 committed by Jobobby04
parent d91d53557a
commit 85af8ea517

View File

@ -1490,6 +1490,14 @@ class MangaInfoScreenModel(
} }
} }
private val Throwable.snackbarMessage: String
get() = when (val className = this::class.simpleName) {
null -> message ?: ""
"SourceNotInstalledException" -> context.getString(R.string.loader_not_implemented_error)
"Exception", "HttpException", "IOException" -> message ?: className
else -> "$className: $message"
}
// SY --> // SY -->
fun showEditMangaInfoDialog() { fun showEditMangaInfoDialog() {
mutableState.update { state -> mutableState.update { state ->
@ -1601,13 +1609,6 @@ val chapterDecimalFormat = DecimalFormat(
.apply { decimalSeparator = '.' }, .apply { decimalSeparator = '.' },
) )
private val Throwable.snackbarMessage: String
get() = when (val className = this::class.simpleName) {
null -> message ?: ""
"Exception", "HttpException", "IOException", "SourceNotInstalledException" -> message ?: className
else -> "$className: $message"
}
// SY --> // SY -->
sealed class PagePreviewState { sealed class PagePreviewState {
object Unused : PagePreviewState() object Unused : PagePreviewState()