It's 'WiFi', not 'Wifi'
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
b946cbc0f3
commit
3e1772ccd0
|
@ -455,17 +455,17 @@ extension TunnelViewModel {
|
|||
switch (activateOnDemandOption) {
|
||||
case .none:
|
||||
return ""
|
||||
case .useOnDemandOverWifiOrCellular:
|
||||
return "Over wifi or cellular"
|
||||
case .useOnDemandOverWifiOnly:
|
||||
return "Over wifi only"
|
||||
case .useOnDemandOverWiFiOrCellular:
|
||||
return "Over WiFi or cellular"
|
||||
case .useOnDemandOverWiFiOnly:
|
||||
return "Over WiFi only"
|
||||
case .useOnDemandOverCellularOnly:
|
||||
return "Over cellular only"
|
||||
}
|
||||
}
|
||||
|
||||
func defaultActivateOnDemandOption() -> ActivateOnDemandOption {
|
||||
return .useOnDemandOverWifiOrCellular
|
||||
return .useOnDemandOverWiFiOrCellular
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -436,10 +436,10 @@ class TunnelDetailTableViewActivateOnDemandCell: UITableViewCell {
|
|||
switch (activateOnDemandSetting.activateOnDemandOption) {
|
||||
case .none:
|
||||
detailText = "Off"
|
||||
case .useOnDemandOverWifiOrCellular:
|
||||
detailText = "Wifi or cellular"
|
||||
case .useOnDemandOverWifiOnly:
|
||||
detailText = "Wifi only"
|
||||
case .useOnDemandOverWiFiOrCellular:
|
||||
detailText = "WiFi or cellular"
|
||||
case .useOnDemandOverWiFiOnly:
|
||||
detailText = "WiFi only"
|
||||
case .useOnDemandOverCellularOnly:
|
||||
detailText = "Cellular only"
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ class TunnelEditTableViewController: UITableViewController {
|
|||
]
|
||||
|
||||
let activateOnDemandOptions: [ActivateOnDemandOption] = [
|
||||
.useOnDemandOverWifiOrCellular,
|
||||
.useOnDemandOverWifiOnly,
|
||||
.useOnDemandOverWiFiOrCellular,
|
||||
.useOnDemandOverWiFiOnly,
|
||||
.useOnDemandOverCellularOnly
|
||||
]
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ struct ActivateOnDemandSetting {
|
|||
|
||||
enum ActivateOnDemandOption {
|
||||
case none // Valid only when isActivateOnDemandEnabled is false
|
||||
case useOnDemandOverWifiOrCellular
|
||||
case useOnDemandOverWifiOnly
|
||||
case useOnDemandOverWiFiOrCellular
|
||||
case useOnDemandOverWiFiOnly
|
||||
case useOnDemandOverCellularOnly
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,9 @@ extension ActivateOnDemandSetting {
|
|||
switch (activateOnDemandOption) {
|
||||
case .none:
|
||||
rules = nil
|
||||
case .useOnDemandOverWifiOrCellular:
|
||||
case .useOnDemandOverWiFiOrCellular:
|
||||
rules = [connectRule]
|
||||
case .useOnDemandOverWifiOnly:
|
||||
case .useOnDemandOverWiFiOnly:
|
||||
connectRule.interfaceTypeMatch = .wiFi
|
||||
disconnectRule.interfaceTypeMatch = .cellular
|
||||
rules = [connectRule, disconnectRule]
|
||||
|
@ -47,12 +47,12 @@ extension ActivateOnDemandSetting {
|
|||
case 1:
|
||||
let rule = rules[0]
|
||||
precondition(rule.action == .connect)
|
||||
activateOnDemandOption = .useOnDemandOverWifiOrCellular
|
||||
activateOnDemandOption = .useOnDemandOverWiFiOrCellular
|
||||
case 2:
|
||||
let connectRule = rules.first(where: { $0.action == .connect })!
|
||||
let disconnectRule = rules.first(where: { $0.action == .disconnect })!
|
||||
if (connectRule.interfaceTypeMatch == .wiFi && disconnectRule.interfaceTypeMatch == .cellular) {
|
||||
activateOnDemandOption = .useOnDemandOverWifiOnly
|
||||
activateOnDemandOption = .useOnDemandOverWiFiOnly
|
||||
} else if (connectRule.interfaceTypeMatch == .cellular && disconnectRule.interfaceTypeMatch == .wiFi) {
|
||||
activateOnDemandOption = .useOnDemandOverCellularOnly
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue