Disable start button if profiles is empty on macOS

This commit is contained in:
世界
2024-02-21 14:14:39 +08:00
parent e9d55c6125
commit be67111425
5 changed files with 8 additions and 2 deletions
@@ -5,6 +5,7 @@ public class ExtensionEnvironments: ObservableObject {
@Published public var logClient = CommandClient(.log)
@Published public var extensionProfileLoading = true
@Published public var extensionProfile: ExtensionProfile?
@Published public var emptyProfiles = false
public let profileUpdate = ObjectWillChangePublisher()
public let selectedProfileUpdate = ObjectWillChangePublisher()
+2 -2
View File
@@ -77,11 +77,11 @@ open class ExtensionProvider: NEPacketTunnelProvider {
do {
profile = try await ProfileManager.get(Int64(SharedPreferences.selectedProfileID.get()))
} catch {
writeFatalError("(packet-tunnel) error: missing default profile: \(error.localizedDescription)")
writeFatalError("(packet-tunnel) error: read selected profile: \(error.localizedDescription)")
return
}
guard let profile else {
writeFatalError("(packet-tunnel) error: missing default profile")
writeFatalError("(packet-tunnel) error: missing selected profile")
return
}
let configContent: String