Tweak intent donations
- Activate -> EnableVPN - Connect -> ConnectVPN/MoveToLocation - Disconnect -> DisableVPN
This commit is contained in:
parent
76d6b2a32a
commit
03c8e43ce7
|
@ -497,7 +497,7 @@ extension OrganizerViewController: ConnectionServiceDelegate {
|
|||
tableView.reloadData()
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
IntentDispatcher.donateConnection(with: profile)
|
||||
IntentDispatcher.donateEnableVPN()
|
||||
}
|
||||
|
||||
// XXX: hack around bad replace when detail presented in compact view
|
||||
|
@ -544,7 +544,7 @@ extension OrganizerViewController: ConnectionServiceDelegate {
|
|||
tableView.reloadData()
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
IntentDispatcher.donateConnection(with: profile)
|
||||
IntentDispatcher.donateEnableVPN()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,6 +227,9 @@ class ServiceViewController: UIViewController, TableModelHost {
|
|||
|
||||
private func toggleVpnService(cell: ToggleTableViewCell) {
|
||||
if cell.isOn {
|
||||
if #available(iOS 12, *) {
|
||||
IntentDispatcher.donateConnection(with: uncheckedProfile)
|
||||
}
|
||||
guard !service.needsCredentials(for: uncheckedProfile) else {
|
||||
let alert = Macros.alert(
|
||||
L10n.Service.Sections.Vpn.header,
|
||||
|
@ -247,16 +250,14 @@ class ServiceViewController: UIViewController, TableModelHost {
|
|||
self.updateViewsIfNeeded()
|
||||
}
|
||||
} else {
|
||||
if #available(iOS 12, *) {
|
||||
IntentDispatcher.donateDisableVPN()
|
||||
}
|
||||
vpn.disconnect { (error) in
|
||||
self.reloadModel()
|
||||
self.updateViewsIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
IntentDispatcher.donateEnableVPN()
|
||||
IntentDispatcher.donateDisableVPN()
|
||||
}
|
||||
}
|
||||
|
||||
private func confirmVpnReconnection() {
|
||||
|
|
Loading…
Reference in New Issue