mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 19:10:39 +00:00
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 3c2a01f903
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
29 lines
1.0 KiB
Swift
29 lines
1.0 KiB
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct OpenClawWatchApp: App {
|
|
@State private var inboxStore = WatchInboxStore()
|
|
@State private var receiver: WatchConnectivityReceiver?
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
WatchInboxView(store: self.inboxStore) { action in
|
|
guard let receiver = self.receiver else { return }
|
|
let draft = self.inboxStore.makeReplyDraft(action: action)
|
|
self.inboxStore.markReplySending(actionLabel: action.label)
|
|
Task { @MainActor in
|
|
let result = await receiver.sendReply(draft)
|
|
self.inboxStore.markReplyResult(result, actionLabel: action.label)
|
|
}
|
|
}
|
|
.task {
|
|
if self.receiver == nil {
|
|
let receiver = WatchConnectivityReceiver(store: self.inboxStore)
|
|
receiver.activate()
|
|
self.receiver = receiver
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|