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
(cherry picked from commit 85af8ea5175de5aef7ad5ec297525c4d889a6fde)
This commit is contained in:
arkon 2023-03-19 17:23:51 -04:00 committed by Jobobby04
parent 9d1b4bf2ec
commit 639a2a9c38

View File

@ -1517,6 +1517,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 -->
fun showEditMangaInfoDialog() {
mutableState.update { state ->
@ -1646,13 +1654,6 @@ val chapterDecimalFormat = DecimalFormat(
.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 -->
sealed class PagePreviewState {
object Unused : PagePreviewState()