Fix chapters list getting updated from wrong thread (fixes #4505)

This commit is contained in:
arkon 2021-03-20 15:35:02 -04:00
parent 6d8c4fb8b1
commit d912a42249

View File

@ -72,6 +72,7 @@ import eu.kanade.tachiyomi.ui.recent.updates.UpdatesController
import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.ui.webview.WebViewActivity
import eu.kanade.tachiyomi.util.chapter.NoChaptersException import eu.kanade.tachiyomi.util.chapter.NoChaptersException
import eu.kanade.tachiyomi.util.hasCustomCover import eu.kanade.tachiyomi.util.hasCustomCover
import eu.kanade.tachiyomi.util.lang.launchUI
import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.util.view.getCoordinates import eu.kanade.tachiyomi.util.view.getCoordinates
@ -988,8 +989,10 @@ class MangaController :
chapters.forEach { chapters.forEach {
chaptersAdapter?.updateItem(it) chaptersAdapter?.updateItem(it)
} }
launchUI {
chaptersAdapter?.notifyDataSetChanged() chaptersAdapter?.notifyDataSetChanged()
} }
}
fun onChaptersDeletedError(error: Throwable) { fun onChaptersDeletedError(error: Throwable) {
Timber.e(error) Timber.e(error)