Trust Ethernet on Mac

This commit is contained in:
Davide De Rosa 2022-05-16 00:45:26 +02:00
parent f5e01f9768
commit 7196aeab0d
2 changed files with 18 additions and 0 deletions

View File

@ -83,6 +83,16 @@ extension OnDemandView {
Toggle(L10n.OnDemand.Items.Mobile.caption, isOn: $onDemand.withMobileNetwork)
} header: {
// TODO: on-demand, restore when "trusted networks" -> "on-demand"
// Text(L10n.Profile.Sections.Trusted.header)
}
Section {
SSIDList(withSSIDs: $onDemand.withSSIDs)
}
} else if Utils.hasEthernet() {
Section {
Toggle(L10n.OnDemand.Items.Ethernet.caption, isOn: $onDemand.withEthernetNetwork)
} header: {
// TODO: on-demand, restore when "trusted networks" -> "on-demand"
// Text(L10n.Profile.Sections.Trusted.header)
}
Section {

View File

@ -51,6 +51,14 @@ extension Utils {
return isFound
}
#endif
public static func hasEthernet() -> Bool {
#if targetEnvironment(macCatalyst) || os(macOS)
true
#else
false
#endif
}
public static func currentWifiSSID() async -> String? {
#if targetEnvironment(simulator)