mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(manga): Loading state
This commit is contained in:
parent
f81be429df
commit
60fe907cc0
1 changed files with 3 additions and 1 deletions
|
@ -174,7 +174,7 @@ class MangaDetailsPresenter(
|
|||
var allHistory: List<History> = emptyList()
|
||||
private set
|
||||
|
||||
val headerItem: MangaHeaderItem by lazy { MangaHeaderItem(mangaId, view?.fromCatalogue == true)}
|
||||
val headerItem: MangaHeaderItem get() = MangaHeaderItem(mangaId, view?.fromCatalogue == true)
|
||||
var tabletChapterHeaderItem: MangaHeaderItem? = null
|
||||
get() {
|
||||
when (view?.isTablet) {
|
||||
|
@ -262,11 +262,13 @@ class MangaDetailsPresenter(
|
|||
val updateChaptersNeeded = runBlocking { setAndGetChapters() }.isEmpty()
|
||||
|
||||
presenterScope.launch {
|
||||
isLoading = true
|
||||
val tasks = listOf(
|
||||
async { if (updateMangaNeeded) fetchMangaFromSource() },
|
||||
async { if (updateChaptersNeeded) fetchChaptersFromSource(false) },
|
||||
)
|
||||
tasks.awaitAll()
|
||||
isLoading = false
|
||||
|
||||
setTrackItems()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue