diff --git a/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift b/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift index 33feeb86a..597a36bdf 100644 --- a/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/DebugMenuView.swift @@ -6,14 +6,10 @@ import Views struct DebugMenuView: View { @EnvironmentObject var authenticator: Authenticator @EnvironmentObject var dataService: DataService - @State private var selectedEnvironment: AppEnvironment + @State private var selectedEnvironment = AppEnvironment.dev let appEnvironments: [AppEnvironment] = [.local, .demo, .dev, .prod] - init(initialEnvironment: AppEnvironment) { - self._selectedEnvironment = State(initialValue: initialEnvironment) - } - var body: some View { VStack { Text("Debug Menu") @@ -38,5 +34,8 @@ struct DebugMenuView: View { .buttonStyle(SolidCapsuleButtonStyle(width: 220)) } .padding() + .onAppear { + selectedEnvironment = dataService.appEnvironment + } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 757893380..d3db63a49 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -76,7 +76,7 @@ struct WelcomeView: View { public var body: some View { primaryContent() .sheet(isPresented: $showDebugModal) { - DebugMenuView(initialEnvironment: dataService.appEnvironment) + DebugMenuView() } .onReceive(Publishers.keyboardHeight) { isKeyboardOnScreen = $0 > 1 } }