mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-26 09:42:06 +00:00
Fix VPN toggle enabling despite errors
This commit is contained in:
parent
e10f33717d
commit
f4714dec58
@ -39,8 +39,10 @@ struct VPNToggle: View {
|
|||||||
.init {
|
.init {
|
||||||
isLocallyEnabled
|
isLocallyEnabled
|
||||||
} set: {
|
} set: {
|
||||||
|
guard toggleVPN() else {
|
||||||
|
return
|
||||||
|
}
|
||||||
isLocallyEnabled = $0
|
isLocallyEnabled = $0
|
||||||
toggleVPN()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +67,9 @@ struct VPNToggle: View {
|
|||||||
}.disabled(!canToggle)
|
}.disabled(!canToggle)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func toggleVPN() {
|
private func toggleVPN() -> Bool {
|
||||||
guard vpnManager.toggle() else {
|
guard vpnManager.toggle() else {
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// rate limit toggle actions
|
// rate limit toggle actions
|
||||||
@ -77,5 +79,6 @@ struct VPNToggle: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onToggle?()
|
onToggle?()
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user