[UX] Fix app quiting in home when back button opens drawer function active.

This commit is contained in:
Kacper Ziubryniewicz 2020-03-20 21:39:38 +01:00
parent 20f16c25a3
commit 87ae5787ee

View File

@ -1151,7 +1151,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
private var targetHomeId: Int = -1
override fun onBackPressed() {
if (!b.navView.onBackPressed()) {
if (App.config.ui.openDrawerOnBackPressed && navTarget.popTo == null && navTarget.popToHome) {
if (App.config.ui.openDrawerOnBackPressed && ((navTarget.popTo == null && navTarget.popToHome)
|| navTarget.id == DRAWER_ITEM_HOME)) {
b.navView.drawer.toggle()
} else {
navigateUp()