mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-07 00:12:02 +00:00
Fix status switch weird state after an error occurs
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
73be704b01
commit
1eb3fd4de0
@ -59,7 +59,7 @@ class TunnelDetailStatusCell: UITableViewCell {
|
|||||||
text = "Waiting"
|
text = "Waiting"
|
||||||
}
|
}
|
||||||
textLabel?.text = text
|
textLabel?.text = text
|
||||||
DispatchQueue.main.async { [weak statusSwitch] in
|
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(200)) { [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)
|
||||||
|
@ -82,7 +82,7 @@ class TunnelListCell: UITableViewCell {
|
|||||||
reset()
|
reset()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async { [weak statusSwitch, weak busyIndicator] in
|
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(200)) { [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)
|
||||||
|
Loading…
Reference in New Issue
Block a user