From abd69d4f91b1a97a681fdb8a21174e3ec61cda7b Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 25 Jul 2020 16:45:27 -0400 Subject: [PATCH] Fix weird backstack behaviour after clearing database Shouldn't affect anything since controllers are recreated when entering different sections. --- .../tachiyomi/ui/base/controller/DialogController.kt | 2 +- .../tachiyomi/ui/setting/SettingsAdvancedController.kt | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.kt index 9fecbecda4..0e487cb03e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.kt +++ b/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 } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index 7775406b8c..4fe194aa95 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/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)