mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-09 12:59:34 +02:00
Show proper string in manga detail screen for SourceNotInstalledException
This commit is contained in:
@@ -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 {
|
sealed class MangaScreenState {
|
||||||
@@ -1014,10 +1022,3 @@ val chapterDecimalFormat = DecimalFormat(
|
|||||||
DecimalFormatSymbols()
|
DecimalFormatSymbols()
|
||||||
.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"
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user