Allow turning off the status switch of a waiting tunnel

It just means the waiting should be cancelled
This commit is contained in:
Roopesh Chander 2018-12-11 01:36:15 +05:30
parent 9906689122
commit 56730ef048
2 changed files with 2 additions and 2 deletions

View File

@ -276,7 +276,7 @@ class TunnelDetailTableViewStatusCell: UITableViewCell {
DispatchQueue.main.async { [weak statusSwitch] in
guard let statusSwitch = statusSwitch else { return }
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
}

View File

@ -390,7 +390,7 @@ class TunnelsListTableViewCell: UITableViewCell {
DispatchQueue.main.async { [weak statusSwitch, weak busyIndicator] in
guard let statusSwitch = statusSwitch, let busyIndicator = busyIndicator else { return }
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) {
busyIndicator.stopAnimating()
} else {