Stops recomposing the drawer at every new route.

This commit is contained in:
Vitor Pamplona
2023-05-22 17:52:18 -04:00
parent 22dbaaf95a
commit 0a8c79dacd
@@ -407,11 +407,8 @@ fun NavigationRow(
route: String route: String
) { ) {
val coroutineScope = rememberCoroutineScope() val coroutineScope = rememberCoroutineScope()
val currentRoute = currentRoute(navController)
IconRow(title, icon, tint, onClick = { IconRow(title, icon, tint, onClick = {
if (currentRoute != route) { navController.navigate(route)
navController.navigate(route)
}
coroutineScope.launch { coroutineScope.launch {
scaffoldState.drawerState.close() scaffoldState.drawerState.close()
} }