Skip to content

Commit

Permalink
Make sure a single modal stack is being presented
Browse files Browse the repository at this point in the history
  • Loading branch information
olivaresf committed May 21, 2024
1 parent 3cf7439 commit b188fc0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class TurboNavigationHierarchyController {
}
case .modal:
if modalNavigationController.presentingViewController != nil, !modalNavigationController.isBeingDismissed {
/// Avoids `Attempt to present on which is already presenting.` in case a modal is being presented.
navigationController.dismiss(animated: proposal.animated)
pushOrReplace(on: modalNavigationController, with: controller, via: proposal)
} else {
modalNavigationController.setViewControllers([controller], animated: proposal.animated)
Expand Down

0 comments on commit b188fc0

Please sign in to comment.