diff --git a/Source/Turbo Navigator/TurboNavigationHierarchyController.swift b/Source/Turbo Navigator/TurboNavigationHierarchyController.swift index 2d855b1..a54b162 100644 --- a/Source/Turbo Navigator/TurboNavigationHierarchyController.swift +++ b/Source/Turbo Navigator/TurboNavigationHierarchyController.swift @@ -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) } }