mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-19 23:41:13 +01:00
@@ -18,6 +18,7 @@ import eu.kanade.domain.manga.model.toSManga
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
import eu.kanade.presentation.manga.DownloadAction
|
||||
import eu.kanade.presentation.manga.components.ChapterDownloadAction
|
||||
import eu.kanade.presentation.util.formattedMessage
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.DownloadCache
|
||||
import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||
@@ -227,7 +228,7 @@ class MangaInfoScreenModel(
|
||||
|
||||
logcat(LogPriority.ERROR, e)
|
||||
coroutineScope.launch {
|
||||
snackbarHostState.showSnackbar(message = e.snackbarMessage)
|
||||
snackbarHostState.showSnackbar(message = with(context) { e.formattedMessage })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -517,7 +518,7 @@ class MangaInfoScreenModel(
|
||||
context.getString(R.string.no_chapters_error)
|
||||
} else {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
e.snackbarMessage
|
||||
with(context) { e.formattedMessage }
|
||||
}
|
||||
|
||||
coroutineScope.launch {
|
||||
@@ -1000,14 +1001,6 @@ 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 {
|
||||
|
||||
Reference in New Issue
Block a user