Skip to content

Commit

Permalink
Respect proposal context when popping
Browse files Browse the repository at this point in the history
  • Loading branch information
olivaresf committed Jun 2, 2024
1 parent 7a59155 commit 8341cbe
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,16 @@ class TurboNavigationHierarchyController {
}

private func pop(via proposal: VisitProposal) {
if navigationController.presentedViewController != nil {
switch proposal.context {
case .default:
navigationController.popViewController(animated: true)

case .modal:
if modalNavigationController.viewControllers.count == 1 {
navigationController.dismiss(animated: proposal.animated)
} else {
modalNavigationController.popViewController(animated: proposal.animated)
}
} else {
navigationController.popViewController(animated: proposal.animated)
}
}

Expand Down

0 comments on commit 8341cbe

Please sign in to comment.