MangaScreenModel: Start downloads in IO dispatcher (#10241)
This commit is contained in:
parent
c6356fe4b2
commit
09531e7f5a
@ -636,18 +636,18 @@ class MangaScreenModel(
|
|||||||
) {
|
) {
|
||||||
val successState = successState ?: return
|
val successState = successState ?: return
|
||||||
|
|
||||||
if (startNow) {
|
screenModelScope.launchNonCancellable {
|
||||||
val chapterId = chapters.singleOrNull()?.id ?: return
|
if (startNow) {
|
||||||
downloadManager.startDownloadNow(chapterId)
|
val chapterId = chapters.singleOrNull()?.id ?: return@launchNonCancellable
|
||||||
} else {
|
downloadManager.startDownloadNow(chapterId)
|
||||||
downloadChapters(chapters)
|
} else {
|
||||||
}
|
downloadChapters(chapters)
|
||||||
|
|
||||||
if (!isFavorited && !successState.hasPromptedToAddBefore) {
|
|
||||||
updateSuccessState { state ->
|
|
||||||
state.copy(hasPromptedToAddBefore = true)
|
|
||||||
}
|
}
|
||||||
screenModelScope.launch {
|
|
||||||
|
if (!isFavorited && !successState.hasPromptedToAddBefore) {
|
||||||
|
updateSuccessState { state ->
|
||||||
|
state.copy(hasPromptedToAddBefore = true)
|
||||||
|
}
|
||||||
val result = snackbarHostState.showSnackbar(
|
val result = snackbarHostState.showSnackbar(
|
||||||
message = context.stringResource(MR.strings.snack_add_to_library),
|
message = context.stringResource(MR.strings.snack_add_to_library),
|
||||||
actionLabel = context.stringResource(MR.strings.action_add),
|
actionLabel = context.stringResource(MR.strings.action_add),
|
||||||
|
Loading…
Reference in New Issue
Block a user