Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix Android back button closing Ensu sidebar

Vishnu Mohandase559a697e634
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt
index 921bb82b52..c15bab1eda 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt
@@ -174,16 +174,20 @@ fun HomeView(
}
}
- BackHandler(enabled = isShowingAuth) {
- isShowingAuth = false
- }
-
BackHandler(enabled = !isChatRoute) {
if (!navController.popBackStack()) {
navController.navigate(HomeRoute.Chat) { launchSingleTop = true }
}
}
+ BackHandler(enabled = drawerState.currentValue == DrawerValue.Open) {
+ scope.launch { drawerState.close() }
+ }
+
+ BackHandler(enabled = isShowingAuth) {
+ isShowingAuth = false
+ }
+
DisposableEffect(lifecycleOwner) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {