From a5bb661dd5a5a63763a214ed4b3d18f68d9c1147 Mon Sep 17 00:00:00 2001 From: Joe Masilotti Date: Wed, 13 Dec 2023 13:36:07 -0800 Subject: [PATCH] If modal is being dismissed then present a new one Fixes an issue where dismissing a modal then presenting a new one right away could cause the new modal to never be presented. --- Source/Turbo Navigator/TurboNavigationHierarchyController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Turbo Navigator/TurboNavigationHierarchyController.swift b/Source/Turbo Navigator/TurboNavigationHierarchyController.swift index acc189d..093ddcc 100644 --- a/Source/Turbo Navigator/TurboNavigationHierarchyController.swift +++ b/Source/Turbo Navigator/TurboNavigationHierarchyController.swift @@ -82,7 +82,7 @@ class TurboNavigationHierarchyController { delegate.visit(visitable, on: .main, with: proposal.options) } case .modal: - if navigationController.presentedViewController != nil { + if navigationController.presentedViewController != nil, !modalNavigationController.isBeingDismissed { pushOrReplace(on: modalNavigationController, with: controller, via: proposal) } else { modalNavigationController.setViewControllers([controller], animated: true)