Omit provider in OpenVPN server configuration

Fixes #744
This commit is contained in:
Davide 2024-10-20 00:21:38 +02:00
parent 2155fe1892
commit ae9e200618
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 11 additions and 2 deletions

View File

@ -70,8 +70,7 @@ struct OpenVPNView: View {
}
var body: some View {
manualView
.modifier(providerModifier)
contentView
.themeAnimation(on: draft, category: .modules)
.moduleView(editor: editor, draft: draft, withName: !isServerPushed)
.navigationDestination(for: Subroute.self, destination: destination)
@ -85,6 +84,16 @@ private extension OpenVPNView {
draft.configurationBuilder ?? .init(withFallbacks: true)
}
@ViewBuilder
var contentView: some View {
if isServerPushed {
manualView
} else {
manualView
.modifier(providerModifier)
}
}
var providerModifier: some ViewModifier {
VPNProviderContentModifier(
providerId: editor.binding(forProviderOf: draft.id),