mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Fix "Add manga to library" snackbar not showing with ChapterDownloadAction.START_NOW (#8271)
This commit is contained in:
parent
9c8ccb8e0e
commit
b3557e844c
1 changed files with 8 additions and 4 deletions
|
@ -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) {
|
||||||
presenter.downloadChapters(chapters)
|
if (startNow) {
|
||||||
|
val chapterId = chapters.singleOrNull()?.id ?: return
|
||||||
|
presenter.startDownloadingNow(chapterId)
|
||||||
|
} else {
|
||||||
|
presenter.downloadChapters(chapters)
|
||||||
|
}
|
||||||
|
|
||||||
if (!presenter.isFavoritedManga) {
|
if (!presenter.isFavoritedManga) {
|
||||||
val result = snackbarHostState.showSnackbar(
|
val result = snackbarHostState.showSnackbar(
|
||||||
|
|
Loading…
Reference in a new issue