Skip to content

Commit

Permalink
iOS navigation: to supported embedded navigation manager, the parent …
Browse files Browse the repository at this point in the history
…route name is used when there is no child route
  • Loading branch information
hugolefrancois committed Apr 18, 2024
1 parent c5d271b commit 9c80dc8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions navigation/ios/NavigationContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ struct NavigationContainerView<
ScreenView: View,
NavModifier: ViewModifier
>: View {
@ObservedObject var navigateState: NavigationState<ScreenData, Route, Action, NavModifier>

@ViewBuilder let buildView: (ScreenData) -> ScreenView
@Environment(\.presentedPilotRouteName) private var presentedRouteName

@ObservedObject private var navigateState: NavigationState<ScreenData, Route, Action, NavModifier>

@ViewBuilder private let buildView: (ScreenData) -> ScreenView

let content: () -> Content

init(navigateState: NavigationState<ScreenData, Route, Action, NavModifier>, buildView: @escaping (ScreenData) -> ScreenView, content: @escaping () -> Content) {
Expand Down Expand Up @@ -70,7 +74,7 @@ struct NavigationContainerView<
)
)
.environment(\.pilotNavigationDismissTriggered, navigateState.navigationDismissTriggered)
.environment(\.presentedPilotRouteName, navigateState.child?.route?.name)
.environment(\.presentedPilotRouteName, navigateState.child?.route?.name ?? presentedRouteName)
}

private var embedInNavigationView: Bool {
Expand Down

0 comments on commit 9c80dc8

Please sign in to comment.