diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/StatusView/NetworkProtectionStatusViewModel.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/StatusView/NetworkProtectionStatusViewModel.swift index 8385f23f26..90225f3822 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/StatusView/NetworkProtectionStatusViewModel.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/StatusView/NetworkProtectionStatusViewModel.swift @@ -128,6 +128,7 @@ extension NetworkProtectionStatusView { onboardingStatusPublisher: onboardingStatusPublisher, statusReporter: statusReporter, vpnSettings: .init(defaults: userDefaults), + proxySettings: .init(defaults: userDefaults), locationFormatter: locationFormatter, uiActionHandler: uiActionHandler) diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift index aceec3f693..9734231fc9 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift @@ -81,33 +81,35 @@ public struct TunnelControllerView: View { } } - SiteTroubleshootingView() - .padding(.top, 5) - - if #available(macOS 14.0, *), - tipsModel.canShowDomainExclusionsTip { - - TipView(tipsModel.domainExclusionsTip) - .tipImageSize(VPNTipsModel.imageSize) - .tipBackground(Color(.tipBackground)) - .padding(.horizontal, 9) - .padding(.vertical, 6) - .onAppear { - tipsModel.handleDomainExclusionsTipShown() - } - .task { - var previousStatus = tipsModel.domainExclusionsTip.status - - for await status in tipsModel.domainExclusionsTip.statusUpdates { - if case .invalidated(let reason) = status { - if case .available = previousStatus { - tipsModel.handleDomainExclusionTipInvalidated(reason) + if model.exclusionsFeatureEnabled { + SiteTroubleshootingView() + .padding(.top, 5) + + if #available(macOS 14.0, *), + tipsModel.canShowDomainExclusionsTip { + + TipView(tipsModel.domainExclusionsTip) + .tipImageSize(VPNTipsModel.imageSize) + .tipBackground(Color(.tipBackground)) + .padding(.horizontal, 9) + .padding(.vertical, 6) + .onAppear { + tipsModel.handleDomainExclusionsTipShown() + } + .task { + var previousStatus = tipsModel.domainExclusionsTip.status + + for await status in tipsModel.domainExclusionsTip.statusUpdates { + if case .invalidated(let reason) = status { + if case .available = previousStatus { + tipsModel.handleDomainExclusionTipInvalidated(reason) + } } - } - previousStatus = status + previousStatus = status + } } - } + } } Divider() diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerViewModel.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerViewModel.swift index b0945d7a6f..ec90d504e9 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerViewModel.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerViewModel.swift @@ -19,6 +19,7 @@ import Combine import Foundation import NetworkProtection +import NetworkProtectionProxy import SwiftUI import TipKit @@ -47,6 +48,10 @@ public final class TunnelControllerViewModel: ObservableObject { } } + public var exclusionsFeatureEnabled: Bool { + proxySettings.proxyAvailable + } + /// The type of extension that's being used for NetP /// @Published @@ -67,6 +72,7 @@ public final class TunnelControllerViewModel: ObservableObject { private let statusReporter: NetworkProtectionStatusReporter private let vpnSettings: VPNSettings + private let proxySettings: TransparentProxySettings private let locationFormatter: VPNLocationFormatting private static let byteCountFormatter: ByteCountFormatter = { @@ -92,6 +98,7 @@ public final class TunnelControllerViewModel: ObservableObject { statusReporter: NetworkProtectionStatusReporter, runLoopMode: RunLoop.Mode? = nil, vpnSettings: VPNSettings, + proxySettings: TransparentProxySettings, locationFormatter: VPNLocationFormatting, uiActionHandler: VPNUIActionHandling) { @@ -100,6 +107,7 @@ public final class TunnelControllerViewModel: ObservableObject { self.statusReporter = statusReporter self.runLoopMode = runLoopMode self.vpnSettings = vpnSettings + self.proxySettings = proxySettings self.locationFormatter = locationFormatter self.uiActionHandler = uiActionHandler