浏览代码

Fix weird backstack behaviour after clearing database

Shouldn't affect anything since controllers are recreated when entering different sections.
arkon 4 年之前
父节点
当前提交
abd69d4f91

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.kt

@@ -98,7 +98,7 @@ abstract class DialogController : RestoreViewOnCreateController {
     /**
      * Dismiss the dialog and pop this controller
      */
-    fun dismissDialog() {
+    private fun dismissDialog() {
         if (dismissed) {
             return
         }

+ 0 - 9
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt

@@ -10,8 +10,6 @@ import android.os.Bundle
 import android.provider.Settings
 import androidx.preference.PreferenceScreen
 import com.afollestad.materialdialogs.MaterialDialog
-import com.bluelinelabs.conductor.RouterTransaction
-import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
 import eu.kanade.tachiyomi.R
 import eu.kanade.tachiyomi.data.cache.ChapterCache
 import eu.kanade.tachiyomi.data.database.DatabaseHelper
@@ -20,7 +18,6 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Target
 import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
 import eu.kanade.tachiyomi.network.NetworkHelper
 import eu.kanade.tachiyomi.ui.base.controller.DialogController
-import eu.kanade.tachiyomi.ui.library.LibraryController
 import eu.kanade.tachiyomi.util.preference.defaultValue
 import eu.kanade.tachiyomi.util.preference.onClick
 import eu.kanade.tachiyomi.util.preference.preference
@@ -173,12 +170,6 @@ class SettingsAdvancedController : SettingsController() {
     }
 
     private fun clearDatabase() {
-        // Avoid weird behavior by going back to the library.
-        val newBackstack = listOf(RouterTransaction.with(LibraryController())) +
-            router.backstack.drop(1)
-
-        router.setBackstack(newBackstack, FadeChangeHandler())
-
         db.deleteMangasNotInLibrary().executeAsBlocking()
         db.deleteHistoryNoLastRead().executeAsBlocking()
         activity?.toast(R.string.clear_database_completed)