Rewrite menu bar extra with AppKit

This commit is contained in:
世界
2026-01-05 19:19:11 +08:00
parent 91edd77b00
commit ce0d7ead88
17 changed files with 666 additions and 301 deletions
@@ -108,20 +108,22 @@ public struct StartStopButton: View {
.disabled(!profile.status.isEnabled)
.alert($alert)
.onReceive(timer) { _ in
currentTime = Date()
Task { @MainActor in
currentTime = Date()
}
}
.onChangeCompat(of: profile.status) { status in
if isStarting {
if status == .disconnected {
isStarting = false
if #available(iOS 16.0, macOS 13.0, tvOS 17.0, *) {
Task {
Task { @MainActor in
if isStarting {
if status == .disconnected {
isStarting = false
if #available(iOS 16.0, macOS 13.0, tvOS 17.0, *) {
await checkStartupError()
}
} else if status.isConnectedStrict {
isStarting = false
environments.commandClient.connect()
}
} else if status.isConnectedStrict {
isStarting = false
environments.commandClient.connect()
}
}
}