瀏覽代碼

Fix crash in clear database screen (fixes #6271)

arkon 3 年之前
父節點
當前提交
6cfd2c510b
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabasePresenter.kt

+ 2 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabasePresenter.kt

@@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper
 import eu.kanade.tachiyomi.source.SourceManager
 import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
 import rx.Observable
+import rx.android.schedulers.AndroidSchedulers
 import rx.schedulers.Schedulers
 import uy.kohesive.injekt.Injekt
 import uy.kohesive.injekt.api.get
@@ -19,6 +20,7 @@ class ClearDatabasePresenter : BasePresenter<ClearDatabaseController>() {
         super.onCreate(savedState)
         getDatabaseSourcesObservable()
             .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
             .subscribeLatestCache(ClearDatabaseController::setItems)
     }