Allow turning off the status switch of a waiting tunnel

It just means the waiting should be cancelled

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2018-12-11 01:36:15 +05:30
parent 9946d8f989
commit 4d63a3e9bd
2 changed files with 2 additions and 2 deletions

View File

@ -276,7 +276,7 @@ class TunnelDetailTableViewStatusCell: UITableViewCell {
DispatchQueue.main.async { [weak statusSwitch] in DispatchQueue.main.async { [weak statusSwitch] in
guard let statusSwitch = statusSwitch else { return } guard let statusSwitch = statusSwitch else { return }
statusSwitch.isOn = !(status == .deactivating || status == .inactive) statusSwitch.isOn = !(status == .deactivating || status == .inactive)
statusSwitch.isUserInteractionEnabled = (status == .inactive || status == .active) statusSwitch.isUserInteractionEnabled = (status == .inactive || status == .active || status == .waiting)
} }
textLabel?.textColor = (status == .active || status == .inactive) ? UIColor.black : UIColor.gray textLabel?.textColor = (status == .active || status == .inactive) ? UIColor.black : UIColor.gray
} }

View File

@ -390,7 +390,7 @@ class TunnelsListTableViewCell: UITableViewCell {
DispatchQueue.main.async { [weak statusSwitch, weak busyIndicator] in DispatchQueue.main.async { [weak statusSwitch, weak busyIndicator] in
guard let statusSwitch = statusSwitch, let busyIndicator = busyIndicator else { return } guard let statusSwitch = statusSwitch, let busyIndicator = busyIndicator else { return }
statusSwitch.isOn = !(status == .deactivating || status == .inactive) statusSwitch.isOn = !(status == .deactivating || status == .inactive)
statusSwitch.isUserInteractionEnabled = (status == .inactive || status == .active) statusSwitch.isUserInteractionEnabled = (status == .inactive || status == .active || status == .waiting)
if (status == .inactive || status == .active) { if (status == .inactive || status == .active) {
busyIndicator.stopAnimating() busyIndicator.stopAnimating()
} else { } else {