fix library update not working since you are calling an update view inside coroutine (#371)

This commit is contained in:
Carlos 2020-05-09 11:51:17 -04:00 committed by GitHub
parent bc93f885b7
commit 1dd9aa5e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,18 +357,14 @@ class LibraryUpdateService(
Timber.e(exception)
stopSelf(startId)
}
if (target == Target.CHAPTERS) {
listener?.onUpdateManga(LibraryManga())
}
job = GlobalScope.launch(handler) {
when (target) {
Target.CHAPTERS -> {
listener?.onUpdateManga(LibraryManga())
updateChaptersJob(mangaToAdd)
}
Target.DETAILS -> {
updateDetails(mangaToAdd)
}
else -> {
updateTrackings(mangaToAdd)
}
Target.CHAPTERS ->updateChaptersJob(mangaToAdd)
Target.DETAILS -> updateDetails(mangaToAdd)
else -> updateTrackings(mangaToAdd)
}
}