fix(manga): Fix crashes

This commit is contained in:
Ahmad Ansori Palembani 2024-12-18 06:00:27 +07:00
parent cba97eb94d
commit 18c5a68981
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 8 additions and 2 deletions

View file

@ -11,6 +11,10 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
## [Unreleased] ## [Unreleased]
### Fixes
- Fix weird flickering when browsing sources
- Fix some crashes
## [1.9.5] ## [1.9.5]
### Changes ### Changes

View file

@ -227,7 +227,9 @@ class MangaDetailsPresenter(
presenterScope.launch { presenterScope.launch {
isLoading = true isLoading = true
withUIContext {
controller.updateHeader() controller.updateHeader()
}
val tasks = listOf( val tasks = listOf(
async { if (fetchMangaNeeded) fetchMangaFromSource() }, async { if (fetchMangaNeeded) fetchMangaFromSource() },
async { if (fetchChaptersNeeded) fetchChaptersFromSource(false) }, async { if (fetchChaptersNeeded) fetchChaptersFromSource(false) },
@ -539,7 +541,7 @@ class MangaDetailsPresenter(
} }
updateChapter.awaitAll(updates) updateChapter.awaitAll(updates)
getChapters() getChapters()
withContext(Dispatchers.Main) { view?.updateChapters() } withUIContext { view?.updateChapters() }
} }
} }