diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 30f4421b9..a6541fe30 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -636,18 +636,18 @@ class MangaScreenModel( ) { val successState = successState ?: return - if (startNow) { - val chapterId = chapters.singleOrNull()?.id ?: return - downloadManager.startDownloadNow(chapterId) - } else { - downloadChapters(chapters) - } - - if (!isFavorited && !successState.hasPromptedToAddBefore) { - updateSuccessState { state -> - state.copy(hasPromptedToAddBefore = true) + screenModelScope.launchNonCancellable { + if (startNow) { + val chapterId = chapters.singleOrNull()?.id ?: return@launchNonCancellable + downloadManager.startDownloadNow(chapterId) + } else { + downloadChapters(chapters) } - screenModelScope.launch { + + if (!isFavorited && !successState.hasPromptedToAddBefore) { + updateSuccessState { state -> + state.copy(hasPromptedToAddBefore = true) + } val result = snackbarHostState.showSnackbar( message = context.stringResource(MR.strings.snack_add_to_library), actionLabel = context.stringResource(MR.strings.action_add),