mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-26 15:16:04 +03:00
Show proper string in manga detail screen for SourceNotInstalledException
This commit is contained in:
parent
abd23b6826
commit
14d1bcacc9
1 changed files with 8 additions and 7 deletions
|
@ -954,6 +954,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"
|
||||
}
|
||||
}
|
||||
|
||||
sealed class MangaScreenState {
|
||||
|
@ -1014,10 +1022,3 @@ val chapterDecimalFormat = DecimalFormat(
|
|||
DecimalFormatSymbols()
|
||||
.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"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue