Skip to content

Commit

Permalink
[Navigation] Prevent pop on root [Android] (#8)
Browse files Browse the repository at this point in the history
Fix issue where it would be possible to pop the root destination, leading to an empty navhost
  • Loading branch information
npresseault authored Apr 9, 2024
1 parent 1bb67fd commit 27ae63e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public open class PilotNavControllerNavigationListener<ROUTE : PilotNavigationRo
}

override fun pop() {
navController.popBackStack()
if (navController.previousBackStackEntry != null) {
navController.popBackStack()
}
}

override fun popTo(route: ROUTE, inclusive: Boolean) {
Expand Down

0 comments on commit 27ae63e

Please sign in to comment.