mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:01:50 +01:00
Fix "Add manga to library" snackbar not showing with ChapterDownloadAction.START_NOW (#8271)
This commit is contained in:
parent
9c8ccb8e0e
commit
b3557e844c
@ -376,8 +376,7 @@ class MangaController : FullComposeController<MangaPresenter> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChapterDownloadAction.START_NOW -> {
|
ChapterDownloadAction.START_NOW -> {
|
||||||
val chapterId = items.singleOrNull()?.chapter?.id ?: return@launch
|
downloadChapters(items.map { it.chapter }, startNow = true)
|
||||||
presenter.startDownloadingNow(chapterId)
|
|
||||||
}
|
}
|
||||||
ChapterDownloadAction.CANCEL -> {
|
ChapterDownloadAction.CANCEL -> {
|
||||||
val chapterId = items.singleOrNull()?.chapter?.id ?: return@launch
|
val chapterId = items.singleOrNull()?.chapter?.id ?: return@launch
|
||||||
@ -390,8 +389,13 @@ class MangaController : FullComposeController<MangaPresenter> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun downloadChapters(chapters: List<DomainChapter>) {
|
private suspend fun downloadChapters(chapters: List<DomainChapter>, startNow: Boolean = false) {
|
||||||
|
if (startNow) {
|
||||||
|
val chapterId = chapters.singleOrNull()?.id ?: return
|
||||||
|
presenter.startDownloadingNow(chapterId)
|
||||||
|
} else {
|
||||||
presenter.downloadChapters(chapters)
|
presenter.downloadChapters(chapters)
|
||||||
|
}
|
||||||
|
|
||||||
if (!presenter.isFavoritedManga) {
|
if (!presenter.isFavoritedManga) {
|
||||||
val result = snackbarHostState.showSnackbar(
|
val result = snackbarHostState.showSnackbar(
|
||||||
|
Loading…
Reference in New Issue
Block a user