Files
openclaw/apps/ios/Sources/ClawdbotApp.swift

32 lines
1.0 KiB
Swift
Raw Normal View History

import SwiftUI
@main
2026-01-04 14:32:47 +00:00
struct ClawdbotApp: App {
@State private var appModel: NodeAppModel
@State private var bridgeController: BridgeConnectionController
@Environment(\.scenePhase) private var scenePhase
2025-12-14 00:23:34 +00:00
init() {
BridgeSettingsStore.bootstrapPersistence()
let appModel = NodeAppModel()
_appModel = State(initialValue: appModel)
_bridgeController = State(initialValue: BridgeConnectionController(appModel: appModel))
2025-12-14 00:23:34 +00:00
}
var body: some Scene {
WindowGroup {
RootCanvas()
.environment(self.appModel)
.environment(self.appModel.voiceWake)
.environment(self.bridgeController)
.onOpenURL { url in
Task { await self.appModel.handleDeepLink(url: url) }
}
.onChange(of: self.scenePhase) { _, newValue in
self.appModel.setScenePhase(newValue)
2025-12-14 00:23:34 +00:00
self.bridgeController.setScenePhase(newValue)
}
}
}
}