bugfix: tapping "Home" in navigation drawer should simply close it without any navigation action.

This commit is contained in:
Han Yin 2025-07-08 13:14:37 -07:00
parent 5b7619f000
commit 4e07a377a3
1 changed files with 7 additions and 1 deletions

View File

@ -134,7 +134,13 @@ private fun DrawerContent(
icon = Icons.Default.Home,
label = "Home",
isSelected = currentRoute == AppDestinations.MODEL_SELECTION_ROUTE,
onClick = { onNavigate { navigationActions.navigateToModelSelection() } }
onClick = {
if (currentRoute != AppDestinations.MODEL_SELECTION_ROUTE) {
onNavigate { navigationActions.navigateToModelSelection() }
} else {
onNavigate { /* No-op: simply close drawer */ }
}
}
)
Spacer(modifier = Modifier.height(24.dp))