diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt index 2bc4596dc..06463c5ab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt @@ -417,7 +417,7 @@ class MangaPresenter( downloadManager.queue.getStatusAsFlow() .filter { it.manga.id == successState?.manga?.id } .catch { error -> logcat(LogPriority.ERROR, error) } - .collectLatest { + .collect { withUIContext { updateDownloadState(it) } @@ -429,7 +429,7 @@ class MangaPresenter( downloadManager.queue.getProgressAsFlow() .filter { it.manga.id == successState?.manga?.id } .catch { error -> logcat(LogPriority.ERROR, error) } - .collectLatest { + .collect { withUIContext { updateDownloadState(it) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt index 4b43498b1..6e34daeb5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt @@ -157,7 +157,7 @@ class UpdatesPresenter( observeDownloadsStatusJob = presenterScope.launchIO { downloadManager.queue.getStatusAsFlow() .catch { error -> logcat(LogPriority.ERROR, error) } - .collectLatest { + .collect { withUIContext { updateDownloadState(it) } @@ -168,7 +168,7 @@ class UpdatesPresenter( observeDownloadsPageJob = presenterScope.launchIO { downloadManager.queue.getProgressAsFlow() .catch { error -> logcat(LogPriority.ERROR, error) } - .collectLatest { + .collect { withUIContext { updateDownloadState(it) }