From 01be43aa7a03e6c3d227f9861002e56f368a9ee0 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 11 Mar 2019 18:09:48 +0530 Subject: on-demand: View model should account for isActivateOnDemandEnabled This is needed to correctly handle NETunnelProviderManager's isOnDemandEnabled property getting changed outside of the app. Signed-off-by: Roopesh Chander --- .../UI/macOS/ViewController/TunnelDetailTableViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift') diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift index 06b505a..9cd9c76 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift @@ -97,7 +97,7 @@ class TunnelDetailTableViewController: NSViewController { self.tunnelsManager = tunnelsManager self.tunnel = tunnel tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) - onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) + onDemandViewModel = ActivateOnDemandViewModel(tunnel: tunnel) super.init(nibName: nil, bundle: nil) updateTableViewModelRowsBySection() updateTableViewModelRows() @@ -500,7 +500,7 @@ extension TunnelDetailTableViewController: NSTableViewDelegate { extension TunnelDetailTableViewController: TunnelEditViewControllerDelegate { func tunnelSaved(tunnel: TunnelContainer) { tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration) - onDemandViewModel = ActivateOnDemandViewModel(option: tunnel.onDemandOption) + onDemandViewModel = ActivateOnDemandViewModel(tunnel: tunnel) updateTableViewModelRowsBySection() updateTableViewModelRows() updateStatus() -- cgit v1.2.3-59-g8ed1b