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

This commit is contained in:
Ivan Iskandar 2022-07-19 03:22:49 +07:00 committed by GitHub
parent b635f02d93
commit 473dc688f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -417,7 +417,7 @@ class MangaPresenter(
downloadManager.queue.getStatusAsFlow() downloadManager.queue.getStatusAsFlow()
.filter { it.manga.id == successState?.manga?.id } .filter { 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)
} }
@ -429,7 +429,7 @@ class MangaPresenter(
downloadManager.queue.getProgressAsFlow() downloadManager.queue.getProgressAsFlow()
.filter { it.manga.id == successState?.manga?.id } .filter { 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

@ -157,7 +157,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)
} }
@ -168,7 +168,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)
} }