From 11e44f9ae5b2fa02164053089babb6b326f23634 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 23 Jan 2019 15:45:24 +0530 Subject: iOS: Fix stale tunnel being shown on iPad When the detail view is shown in the iPad and we delete the current tunnel with a list view swipe rather than the delete button, the detail view should go blank. Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'WireGuard/WireGuard/Tunnel') diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 82d10a3..75d8230 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -9,7 +9,7 @@ protocol TunnelsManagerListDelegate: class { func tunnelAdded(at index: Int) func tunnelModified(at index: Int) func tunnelMoved(from oldIndex: Int, to newIndex: Int) - func tunnelRemoved(at index: Int) + func tunnelRemoved(at index: Int, tunnel: TunnelContainer) } protocol TunnelsManagerActivationDelegate: class { @@ -65,7 +65,7 @@ class TunnelsManager { if !loadedTunnelProviders.contains(where: { $0.tunnelConfiguration == currentTunnel.tunnelConfiguration }) { // Tunnel was deleted outside the app self.tunnels.remove(at: index) - self.tunnelsListDelegate?.tunnelRemoved(at: index) + self.tunnelsListDelegate?.tunnelRemoved(at: index, tunnel: currentTunnel) } } for loadedTunnelProvider in loadedTunnelProviders { @@ -212,7 +212,7 @@ class TunnelsManager { if let self = self { let index = self.tunnels.firstIndex(of: tunnel)! self.tunnels.remove(at: index) - self.tunnelsListDelegate?.tunnelRemoved(at: index) + self.tunnelsListDelegate?.tunnelRemoved(at: index, tunnel: tunnel) } completionHandler(nil) } -- cgit v1.2.3-59-g8ed1b