Fix missing Window on iOS

Broken by 9e6e59276b
This commit is contained in:
Davide De Rosa 2024-09-28 11:56:03 +02:00
parent 9e6e59276b
commit c0234b07a8
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 26 additions and 20 deletions

View File

@ -48,26 +48,32 @@ struct PassepartoutApp: App {
private var theme = Theme()
var body: some Scene {
Window(appName, id: appName) {
AppCoordinator(
profileManager: context.profileManager,
tunnel: context.tunnel,
registry: context.registry
)
.onLoad {
CommonLibrary.configureLogging(
to: Constants.shared.urlForAppLog,
parameters: Constants.shared.log
)
AppUI.configure(with: context)
}
.themeLockScreen()
.environmentObject(theme)
.environmentObject(context.iapManager)
.environmentObject(context.connectionObserver)
}
#if os(macOS)
.defaultSize(width: 600.0, height: 400.0)
#if os(iOS)
WindowGroup(content: content)
#else
Window(appName, id: appName, content: content)
.defaultSize(width: 600.0, height: 400.0)
#endif
}
}
private extension PassepartoutApp {
func content() -> some View {
AppCoordinator(
profileManager: context.profileManager,
tunnel: context.tunnel,
registry: context.registry
)
.onLoad {
CommonLibrary.configureLogging(
to: Constants.shared.urlForAppLog,
parameters: Constants.shared.log
)
AppUI.configure(with: context)
}
.themeLockScreen()
.environmentObject(theme)
.environmentObject(context.iapManager)
.environmentObject(context.connectionObserver)
}
}