Skip to content

Commit

Permalink
Allow Ethernet on-demand on all platforms (#1012)
Browse files Browse the repository at this point in the history
Fixes #1010
  • Loading branch information
keeshux authored Dec 14, 2024
1 parent b9353a6 commit a04c107
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Library/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : {
"revision" : "234a709bfd18f5b31fdf0b44f0f09c84f9c76581",
"version" : "0.13.0"
"revision" : "a08e04fccde51d92d5bed3fbe1880c4225f18618"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Library/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ let package = Package(
)
],
dependencies: [
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.13.0"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "406712a60faf8208a15c4ffaf286b1c71df7c6d2"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.13.0"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "a08e04fccde51d92d5bed3fbe1880c4225f18618"),
// .package(path: "../../passepartoutkit-source"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.13.0"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),
Expand Down
3 changes: 2 additions & 1 deletion Library/Sources/AppUIMain/Views/Modules/OnDemandView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ private extension OnDemandView {
Group {
if Utils.hasCellularData() {
Toggle(Strings.Modules.OnDemand.mobile, isOn: draft.withMobileNetwork)
} else if Utils.hasEthernet() {
}
if Utils.hasEthernet() {
Toggle(Strings.Modules.OnDemand.ethernet, isOn: draft.withEthernetNetwork)
}
}
Expand Down
5 changes: 1 addition & 4 deletions Library/Sources/CommonUtils/Extensions/Utils+Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extension Utils {
true
}
#else
// TODO: ###, move this check to kit, and try something similar for Ethernet
public static func hasCellularData() -> Bool {
var addrs: UnsafeMutablePointer<ifaddrs>?
guard getifaddrs(&addrs) == 0 else {
Expand All @@ -57,11 +58,7 @@ extension Utils {
#endif

public static func hasEthernet() -> Bool {
#if os(macOS)
true
#else
false
#endif
}

public static func currentWifiSSID() async -> String? {
Expand Down

0 comments on commit a04c107

Please sign in to comment.