Show proper string in manga detail screen for SourceNotInstalledException
(cherry picked from commit 14d1bcacc9
)
Cette révision appartient à :
Parent
bf85e147e7
révision
38428c6ebe
1 fichiers modifiés avec 8 ajouts et 7 suppressions
|
@ -977,6 +977,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 {
|
||||
|
@ -1055,10 +1063,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"
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket