Here is my button code
Button("Map") {
openWindow(id: "Navigate")
dismissWindow(id: "Begin")
}
And here is my main app coding with all the scenes:
var body: some Scene {
WindowGroup(id: "Begin") {
MainMenuView()
}
WindowGroup(id: "Navigate") {
MapView()
}
ImmersiveSpace(id: "ImmersiveSpace") {
ImmersiveView()
}.immersionStyle(selection: .constant(.full), in: .full)
}
It would not dismiss the begin window when I click on the button meaning the window is not gone and it just opens the navigate window. Can you please update my code to switch between views in the same window and fix the problem please?