Clean up some code

- Drop stale generic

- Improve readability
This commit is contained in:
Davide De Rosa 2023-03-16 14:08:47 +01:00
parent 3f6c71e4f5
commit 17b01a4dbc
2 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -32,7 +32,7 @@ import TunnelKitOpenVPNCore
import PassepartoutCore
import PassepartoutUtils
public class TunnelKitVPNManagerStrategy<VPNType: VPN>: 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<VPNType: VPN>: 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<VPNType: VPN>: VPNManagerStrategy where
public init(
appGroup: String,
tunnelBundleIdentifier: @escaping (VPNProtocolType) -> String,
vpn: VPNType,
vpn: NetworkExtensionVPN,
dataCountInterval: TimeInterval = 3.0
) {
self.appGroup = appGroup