From 7161c218079fb11a576cbb13f8dc7da8a4faa48e Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Wed, 9 Sep 2020 03:12:38 -0700 Subject: [PATCH] Cleanup --- Views/SecondaryNavigationView.swift | 3 +-- Views/TabNavigationView.swift | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Views/SecondaryNavigationView.swift b/Views/SecondaryNavigationView.swift index 382d189..ccdba93 100644 --- a/Views/SecondaryNavigationView.swift +++ b/Views/SecondaryNavigationView.swift @@ -7,7 +7,6 @@ import ViewModels struct SecondaryNavigationView: View { @EnvironmentObject var identification: Identification @EnvironmentObject var tabNavigationViewModel: TabNavigationViewModel - @Environment(\.presentationMode) var presentationMode @Environment(\.displayScale) var displayScale: CGFloat var body: some View { @@ -69,7 +68,7 @@ struct SecondaryNavigationView: View { .toolbar { ToolbarItem(placement: .cancellationAction) { Button { - presentationMode.wrappedValue.dismiss() + tabNavigationViewModel.presentingSecondaryNavigation = false } label: { Image(systemName: "xmark.circle.fill") } diff --git a/Views/TabNavigationView.swift b/Views/TabNavigationView.swift index e1833b6..c0040f2 100644 --- a/Views/TabNavigationView.swift +++ b/Views/TabNavigationView.swift @@ -27,6 +27,7 @@ struct TabNavigationView: View { .sheet(isPresented: $viewModel.presentingSecondaryNavigation) { SecondaryNavigationView() .environmentObject(viewModel) + .environmentObject(rootViewModel) } .alertItem($viewModel.alertItem) .onAppear(perform: viewModel.refreshIdentity)