app: don't pop back stack if already on route

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-11-12 01:54:50 +05:30
parent ff4dfcac61
commit e5a6c97058
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -100,8 +100,8 @@ fun LobstersBottomNav(
selected = currentRoute == screen.route,
alwaysShowLabels = false,
onClick = {
navController.popBackStack(navController.graph.startDestination, false)
if (currentRoute != screen.route) {
navController.popBackStack(navController.graph.startDestination, false)
navController.navigate(screen.route)
}
}