mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
pass in appenv binding to debug view
This commit is contained in:
parent
1aaab4d337
commit
da70e40c6a
2 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ import Views
|
|||
struct DebugMenuView: View {
|
||||
@EnvironmentObject var authenticator: Authenticator
|
||||
@EnvironmentObject var dataService: DataService
|
||||
@State private var selectedEnvironment = AppEnvironment.dev
|
||||
@Binding var selectedEnvironment: AppEnvironment
|
||||
|
||||
let appEnvironments: [AppEnvironment] = [.local, .demo, .dev, .prod]
|
||||
|
||||
|
|
@ -34,8 +34,5 @@ struct DebugMenuView: View {
|
|||
.buttonStyle(SolidCapsuleButtonStyle(width: 220))
|
||||
}
|
||||
.padding()
|
||||
.onAppear {
|
||||
selectedEnvironment = dataService.appEnvironment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import Combine
|
||||
import Models
|
||||
import Services
|
||||
import SwiftUI
|
||||
import Utils
|
||||
|
|
@ -10,6 +11,7 @@ struct WelcomeView: View {
|
|||
@State private var showRegistrationView = false
|
||||
@State private var isKeyboardOnScreen = false
|
||||
@State private var showDebugModal = false
|
||||
@State private var selectedEnvironment = AppEnvironment.initialAppEnvironment
|
||||
|
||||
func handleHiddenGestureAction() {
|
||||
if !Bundle.main.isAppStoreBuild {
|
||||
|
|
@ -76,8 +78,9 @@ struct WelcomeView: View {
|
|||
public var body: some View {
|
||||
primaryContent()
|
||||
.sheet(isPresented: $showDebugModal) {
|
||||
DebugMenuView()
|
||||
DebugMenuView(selectedEnvironment: $selectedEnvironment)
|
||||
}
|
||||
.onReceive(Publishers.keyboardHeight) { isKeyboardOnScreen = $0 > 1 }
|
||||
.onAppear { selectedEnvironment = dataService.appEnvironment }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue