Problem about. .windowStyle

    WindowGroup{
        SolarDisplayView()
            .environment(model)
    }
    .windowStyle(.plain)

Why is the code above correct while the code below reports an error? How to modify the following code?

   WindowGroup{
        SolarDisplayView()
            .environment(model)
    }
    .windowStyle(model.isShow ? .plain : .automatic)

This is because the types of .plain and .automatic are actually not the same. .plain is a static property of PlainWindowStyle, and .automatic is a static property of DefaultWindowStyle.

Problem about. .windowStyle
 
 
Q