Fix download status not updated properly after starting batch download (#7561)

(cherry picked from commit 473dc688f0bbb9732e3d75d137bc7025418d9bcf)
This commit is contained in:
Ivan Iskandar 2022-07-19 03:22:49 +07:00 committed by Jobobby04
parent c69f53a8f4
commit 8bd7f95afc
2 changed files with 4 additions and 4 deletions

View File

@ -826,7 +826,7 @@ class MangaPresenter(
downloadManager.queue.getStatusAsFlow() downloadManager.queue.getStatusAsFlow()
.filter { /* SY --> */ if (isMergedSource) it.manga.id in mergedIds else /* SY <-- */ it.manga.id == successState?.manga?.id } .filter { /* SY --> */ if (isMergedSource) it.manga.id in mergedIds else /* SY <-- */ it.manga.id == successState?.manga?.id }
.catch { error -> logcat(LogPriority.ERROR, error) } .catch { error -> logcat(LogPriority.ERROR, error) }
.collectLatest { .collect {
withUIContext { withUIContext {
updateDownloadState(it) updateDownloadState(it)
} }
@ -838,7 +838,7 @@ class MangaPresenter(
downloadManager.queue.getProgressAsFlow() downloadManager.queue.getProgressAsFlow()
.filter { /* SY --> */ if (isMergedSource) it.manga.id in mergedIds else /* SY <-- */ it.manga.id == successState?.manga?.id } .filter { /* SY --> */ if (isMergedSource) it.manga.id in mergedIds else /* SY <-- */ it.manga.id == successState?.manga?.id }
.catch { error -> logcat(LogPriority.ERROR, error) } .catch { error -> logcat(LogPriority.ERROR, error) }
.collectLatest { .collect {
withUIContext { withUIContext {
updateDownloadState(it) updateDownloadState(it)
} }

View File

@ -159,7 +159,7 @@ class UpdatesPresenter(
observeDownloadsStatusJob = presenterScope.launchIO { observeDownloadsStatusJob = presenterScope.launchIO {
downloadManager.queue.getStatusAsFlow() downloadManager.queue.getStatusAsFlow()
.catch { error -> logcat(LogPriority.ERROR, error) } .catch { error -> logcat(LogPriority.ERROR, error) }
.collectLatest { .collect {
withUIContext { withUIContext {
updateDownloadState(it) updateDownloadState(it)
} }
@ -170,7 +170,7 @@ class UpdatesPresenter(
observeDownloadsPageJob = presenterScope.launchIO { observeDownloadsPageJob = presenterScope.launchIO {
downloadManager.queue.getProgressAsFlow() downloadManager.queue.getProgressAsFlow()
.catch { error -> logcat(LogPriority.ERROR, error) } .catch { error -> logcat(LogPriority.ERROR, error) }
.collectLatest { .collect {
withUIContext { withUIContext {
updateDownloadState(it) updateDownloadState(it)
} }