Removed coroutine on manga presenter launch

Since the page scroll is reset on theme switch
This commit is contained in:
Jay 2020-08-09 16:13:04 -04:00
parent 281470252b
commit 23e7b380b0

View File

@ -83,32 +83,25 @@ class MangaDetailsPresenter(
var headerItem = MangaHeaderItem(manga, controller.fromCatalogue) var headerItem = MangaHeaderItem(manga, controller.fromCatalogue)
fun onCreate() { fun onCreate() {
scope.launch {
withContext(Dispatchers.IO) { isLockedFromSearch = SecureActivityDelegate.shouldBeLocked()
isLockedFromSearch = SecureActivityDelegate.shouldBeLocked() headerItem.isLocked = isLockedFromSearch
headerItem.isLocked = isLockedFromSearch downloadManager.addListener(this)
downloadManager.addListener(this@MangaDetailsPresenter) LibraryUpdateService.setListener(this)
LibraryUpdateService.setListener(this@MangaDetailsPresenter) tracks = db.getTracks(manga).executeAsBlocking()
tracks = db.getTracks(manga).executeAsBlocking() if (manga.source == LocalSource.ID) {
if (manga.source == LocalSource.ID) { refreshAll()
refreshAll() } else if (!manga.initialized) {
} else if (!manga.initialized) { isLoading = true
isLoading = true controller.setRefresh(true)
withContext(Dispatchers.Main) { controller.updateHeader()
controller.setRefresh(true) refreshAll()
controller.updateHeader() } else {
} updateChapters()
refreshAll() controller.updateChapters(this.chapters)
} else {
updateChapters()
withContext(Dispatchers.Main) {
controller.updateChapters(this@MangaDetailsPresenter.chapters)
}
}
setTrackItems()
refreshTracking(false)
}
} }
setTrackItems()
refreshTracking(false)
} }
fun onDestroy() { fun onDestroy() {