Skip to content

Commit

Permalink
Remove animated
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Olivares committed Jul 4, 2024
1 parent 160140c commit 75d9a57
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Source/Turbo Navigator/TurboNavigationHierarchyController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,31 +165,31 @@ class TurboNavigationHierarchyController {
}

private func refresh(via proposal: VisitProposal) {
let stackToRefresh: NavigationStackType
if navigationController.presentedViewController != nil {
if modalNavigationController.viewControllers.count == 1 {
navigationController.dismiss(animated: proposal.animated)
stackToRefresh = .main
refreshIfTopViewControllerIsVisitable(from: .main)
} else {
modalNavigationController.popViewController(animated: proposal.animated)
stackToRefresh = .modal
refreshIfTopViewControllerIsVisitable(from: .modal)
}
} else {
navigationController.popViewController(animated: proposal.animated)
stackToRefresh = .main
refreshIfTopViewControllerIsVisitable(from: .main)
}

/// Once the navigation stack is updated, notify the session so it refreshes the topmost visitable.
if let navControllerTopmostVisitable = navController(for: stackToRefresh).topViewController as? Visitable {
self.delegate.refreshVisitable(navigationStack: stackToRefresh,
}

private func refreshIfTopViewControllerIsVisitable(from stack: NavigationStackType) {
if let navControllerTopmostVisitable = navController(for: stack).topViewController as? Visitable {
self.delegate.refreshVisitable(navigationStack: stack,
newTopmostVisitable: navControllerTopmostVisitable)
}
}

private func clearAll(via proposal: VisitProposal) {
navigationController.dismiss(animated: proposal.animated)
navigationController.popToRootViewController(animated: proposal.animated)
refreshIfTopViewControllerIsVisitable(from: .main, animated: proposal.animated)
refreshIfTopViewControllerIsVisitable(from: .main)
}

private func replaceRoot(with controller: UIViewController, via proposal: VisitProposal) {
Expand Down

0 comments on commit 75d9a57

Please sign in to comment.