diff --git a/Passepartout/App/Views/AddProviderView.swift b/Passepartout/App/Views/AddProviderView.swift index 7e17788b..7fa666db 100644 --- a/Passepartout/App/Views/AddProviderView.swift +++ b/Passepartout/App/Views/AddProviderView.swift @@ -135,11 +135,11 @@ struct AddProviderView: View { // eligibility: select or purchase provider private func presentOrPurchaseProvider(_ metadata: ProviderMetadata) { - if productManager.isEligible(forProvider: metadata.name) { - viewModel.selectProvider(metadata, providerManager) - } else { + guard productManager.isEligible(forProvider: metadata.name) else { viewModel.presentPaywall() + return } + viewModel.selectProvider(metadata, providerManager) } private func onErrorMessage(_ message: String?, _ scrollProxy: ScrollViewProxy) { diff --git a/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/TunnelKitVPNManagerStrategy.swift b/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/TunnelKitVPNManagerStrategy.swift index ff9847e1..3da06fc5 100644 --- a/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/TunnelKitVPNManagerStrategy.swift +++ b/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/TunnelKitVPNManagerStrategy.swift @@ -32,7 +32,7 @@ import TunnelKitOpenVPNCore import PassepartoutCore import PassepartoutUtils -public class TunnelKitVPNManagerStrategy: VPNManagerStrategy where VPNType.Configuration == NetworkExtensionConfiguration, VPNType.Extra == NetworkExtensionExtra { +public class TunnelKitVPNManagerStrategy: VPNManagerStrategy { private struct AtomicState: Equatable { let isEnabled: Bool @@ -52,7 +52,7 @@ public class TunnelKitVPNManagerStrategy: VPNManagerStrategy where private let defaults: UserDefaults - private let vpn: VPNType + private let vpn: NetworkExtensionVPN private let dataCountInterval: TimeInterval @@ -73,7 +73,7 @@ public class TunnelKitVPNManagerStrategy: VPNManagerStrategy where public init( appGroup: String, tunnelBundleIdentifier: @escaping (VPNProtocolType) -> String, - vpn: VPNType, + vpn: NetworkExtensionVPN, dataCountInterval: TimeInterval = 3.0 ) { self.appGroup = appGroup