mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Move when fetching history is done in details page
This commit is contained in:
parent
a86e7979f7
commit
55ae1f32f2
1 changed files with 8 additions and 1 deletions
|
@ -136,6 +136,7 @@ class MangaDetailsPresenter(
|
||||||
} else {
|
} else {
|
||||||
runBlocking { getChapters() }
|
runBlocking { getChapters() }
|
||||||
controller.updateChapters(this.chapters)
|
controller.updateChapters(this.chapters)
|
||||||
|
getHistory()
|
||||||
}
|
}
|
||||||
presenterScope.launch {
|
presenterScope.launch {
|
||||||
setTrackItems()
|
setTrackItems()
|
||||||
|
@ -153,6 +154,7 @@ class MangaDetailsPresenter(
|
||||||
getChapters()
|
getChapters()
|
||||||
if (andTracking) fetchTracks()
|
if (andTracking) fetchTracks()
|
||||||
withContext(Dispatchers.Main) { view?.updateChapters(chapters) }
|
withContext(Dispatchers.Main) { view?.updateChapters(chapters) }
|
||||||
|
getHistory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,8 +172,11 @@ class MangaDetailsPresenter(
|
||||||
// Store the last emission
|
// Store the last emission
|
||||||
allChapters = chapters
|
allChapters = chapters
|
||||||
this.chapters = applyChapterFilters(chapters)
|
this.chapters = applyChapterFilters(chapters)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getHistory() {
|
||||||
presenterScope.launchIO {
|
presenterScope.launchIO {
|
||||||
allHistory = manga.id?.let { db.getHistoryByMangaId(it).executeOnIO() }.orEmpty()
|
allHistory = manga.id?.let { db.getHistoryByMangaId(it).executeAsBlocking() }.orEmpty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,6 +433,7 @@ class MangaDetailsPresenter(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getHistory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,6 +459,7 @@ class MangaDetailsPresenter(
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
view?.updateChapters(this@MangaDetailsPresenter.chapters)
|
view?.updateChapters(this@MangaDetailsPresenter.chapters)
|
||||||
}
|
}
|
||||||
|
getHistory()
|
||||||
} catch (e: java.lang.Exception) {
|
} catch (e: java.lang.Exception) {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
view?.showError(trimException(e))
|
view?.showError(trimException(e))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue