Fix missing async in Demo
This commit is contained in:
parent
6e7eab421e
commit
7b72114893
|
@ -80,7 +80,9 @@ class OpenVPNViewController: UIViewController {
|
|||
object: nil
|
||||
)
|
||||
|
||||
vpn.prepare()
|
||||
Task {
|
||||
await vpn.prepare()
|
||||
}
|
||||
|
||||
// testFetchRef()
|
||||
}
|
||||
|
@ -123,14 +125,16 @@ class OpenVPNViewController: UIViewController {
|
|||
return
|
||||
}
|
||||
|
||||
var extra = NetworkExtensionExtra()
|
||||
extra.passwordReference = passwordReference
|
||||
vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg!,
|
||||
extra: extra,
|
||||
after: .seconds(2)
|
||||
)
|
||||
Task {
|
||||
var extra = NetworkExtensionExtra()
|
||||
extra.passwordReference = passwordReference
|
||||
try await vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg!,
|
||||
extra: extra,
|
||||
after: .seconds(2)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func disconnect() {
|
||||
|
|
|
@ -75,7 +75,9 @@ class OpenVPNViewController: NSViewController {
|
|||
object: nil
|
||||
)
|
||||
|
||||
vpn.prepare()
|
||||
Task {
|
||||
await vpn.prepare()
|
||||
}
|
||||
|
||||
// testFetchRef()
|
||||
}
|
||||
|
@ -114,18 +116,22 @@ class OpenVPNViewController: NSViewController {
|
|||
return
|
||||
}
|
||||
|
||||
var extra = NetworkExtensionExtra()
|
||||
extra.passwordReference = passwordReference
|
||||
vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg!,
|
||||
extra: extra,
|
||||
after: .seconds(2)
|
||||
)
|
||||
Task {
|
||||
var extra = NetworkExtensionExtra()
|
||||
extra.passwordReference = passwordReference
|
||||
try await vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg!,
|
||||
extra: extra,
|
||||
after: .seconds(2)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func disconnect() {
|
||||
vpn.disconnect()
|
||||
Task {
|
||||
await vpn.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
func updateButton() {
|
||||
|
|
|
@ -72,7 +72,9 @@ class WireGuardViewController: NSViewController {
|
|||
object: nil
|
||||
)
|
||||
|
||||
vpn.prepare()
|
||||
Task {
|
||||
await vpn.prepare()
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func connectionClicked(_ sender: Any) {
|
||||
|
@ -105,16 +107,20 @@ class WireGuardViewController: NSViewController {
|
|||
return
|
||||
}
|
||||
|
||||
vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg,
|
||||
extra: nil,
|
||||
after: .seconds(2)
|
||||
)
|
||||
Task {
|
||||
try await vpn.reconnect(
|
||||
tunnelIdentifier,
|
||||
configuration: cfg,
|
||||
extra: nil,
|
||||
after: .seconds(2)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func disconnect() {
|
||||
vpn.disconnect()
|
||||
Task {
|
||||
await vpn.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
func updateButton() {
|
||||
|
|
Loading…
Reference in New Issue