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 -> {
|
||||
val chapterId = items.singleOrNull()?.chapter?.id ?: return@launch
|
||||
presenter.startDownloadingNow(chapterId)
|
||||
downloadChapters(items.map { it.chapter }, startNow = true)
|
||||
}
|
||||
ChapterDownloadAction.CANCEL -> {
|
||||
val chapterId = items.singleOrNull()?.chapter?.id ?: return@launch
|
||||
@ -390,8 +389,13 @@ class MangaController : FullComposeController<MangaPresenter> {
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun downloadChapters(chapters: List<DomainChapter>) {
|
||||
presenter.downloadChapters(chapters)
|
||||
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)
|
||||
}
|
||||
|
||||
if (!presenter.isFavoritedManga) {
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
|
Loading…
Reference in New Issue
Block a user