From 7c64f582c83026157041993da9a2525d4c44e192 Mon Sep 17 00:00:00 2001 From: Eton Otieno Date: Thu, 17 Oct 2024 23:29:19 +0300 Subject: [PATCH] Hide modal drawer when opening the main app screen --- .../kotlin/io/devbits/gocart/ui/GoCartApp.kt | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/android/src/main/kotlin/io/devbits/gocart/ui/GoCartApp.kt b/android/src/main/kotlin/io/devbits/gocart/ui/GoCartApp.kt index 4128e24..264e71a 100644 --- a/android/src/main/kotlin/io/devbits/gocart/ui/GoCartApp.kt +++ b/android/src/main/kotlin/io/devbits/gocart/ui/GoCartApp.kt @@ -71,24 +71,22 @@ fun GoCartApp( // Disable gestures on non DestinationRoutes ModalNavigationDrawer( drawerContent = { - if (appState.currentDestinationRoute != null) { - ModalDrawerSheet { - GoCartNavDrawerContent( - isLoggedIn = isLoggedIn, - onClickHeader = { }, - onSignUp = { - appState.scope.launch { drawerState.close() } - appState.navController.popBackStack() - appState.navController.navigateToAuth() - }, - items = NavDrawerItem.entries, - onClick = { - if (it == NavDrawerItem.LOGOUT) onLogout() - appState.scope.launch { drawerState.close() } - appState.navigateToRoute(it) - }, - ) - } + ModalDrawerSheet { + GoCartNavDrawerContent( + isLoggedIn = isLoggedIn, + onClickHeader = { }, + onSignUp = { + appState.scope.launch { drawerState.close() } + appState.navController.popBackStack() + appState.navController.navigateToAuth() + }, + items = NavDrawerItem.entries, + onClick = { + if (it == NavDrawerItem.LOGOUT) onLogout() + appState.scope.launch { drawerState.close() } + appState.navigateToRoute(it) + }, + ) } }, drawerState = drawerState,