From e8d68396cab079255db6183a65f889b0dd71039c Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sat, 10 Nov 2018 15:50:56 +0530 Subject: VPN: When activating while another tunnel is active, deactivate the other tunnel Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift | 15 --------------- .../UI/iOS/TunnelDetailTableViewController.swift | 2 ++ 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'WireGuard/WireGuard/UI') diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift index d06f632..fd56588 100644 --- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift +++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift @@ -23,21 +23,6 @@ class ErrorPresenter { // TunnelActivationError case TunnelActivationError.tunnelActivationFailed: return ("Activation failure", "The tunnel could not be activated due to an internal error") - case TunnelActivationError.attemptingActivationWhenAnotherTunnelIsBusy(let otherTunnelStatus): - let statusString: String = { - switch (otherTunnelStatus) { - case .active: fallthrough - case .reasserting: fallthrough - case .restarting: - return "active" - case .activating: fallthrough - case .deactivating: - return "being deactivated" - case .inactive: - fatalError() - } - }() - return ("Activation failure", "Another tunnel is currently \(statusString)") default: os_log("ErrorPresenter: Error not presented: %{public}@", log: OSLog.default, type: .error, "\(error)") diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift index 5209b3a..92d5c64 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift @@ -259,6 +259,8 @@ class TunnelDetailTableViewStatusCell: UITableViewCell { text = "Reactivating" case .restarting: text = "Restarting" + case .waiting: + text = "Waiting" } textLabel?.text = text DispatchQueue.main.async { [weak statusSwitch] in -- cgit v1.2.3-59-g8ed1b