Skip to content

Commit

Permalink
Implement navigation to same screen again
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaronixon committed Oct 8, 2023
1 parent c33ad41 commit 23a68ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ class TurboNavigationController : UINavigationController {
}

// - Create view controller appropriate for url/properties
// - Navigate to that with the correct presentation
let viewController = makeViewController(for: url, properties: properties)
navigate(to: viewController, action: options.action, properties: properties)

// - Navigate to that with the correct presentation
if session.topmostVisitable?.visitableURL == url {
navigate(to: viewController, action: .replace, properties: properties)
} else {
navigate(to: viewController, action: options.action, properties: properties)
}

// Initiate the visit with Turbo
if isVisitable(properties) {
Expand Down Expand Up @@ -77,7 +82,7 @@ extension TurboNavigationController {

private func title(from properties: PathProperties) -> String? {
return properties["title"] as? String
}
}

private func noticeMessage(from url: URL) -> String? {
URLComponents(url: url, resolvingAgainstBaseURL: false)?.queryItems?.first(where: { $0.name == "notice" })?.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ class TurboNavigationController : UINavigationController {
}

// - Create view controller appropriate for url/properties
// - Navigate to that with the correct presentation
let viewController = makeViewController(for: url, properties: properties)
navigate(to: viewController, action: options.action, properties: properties)

// - Navigate to that with the correct presentation
if session.topmostVisitable?.visitableURL == url {
navigate(to: viewController, action: .replace, properties: properties)
} else {
navigate(to: viewController, action: options.action, properties: properties)
}

// Initiate the visit with Turbo
if isVisitable(properties) {
Expand Down

0 comments on commit 23a68ac

Please sign in to comment.