a6939453f8
CI / test (push) Has been cancelled
Move the app payload under swift/ while keeping git, package.json, and .smartconfig.json at the repo root. This standardizes the Swift app setup so build, test, run, and watch workflows match the other repos.
34 lines
857 B
Swift
34 lines
857 B
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct IDPGlobalWatchApp: App {
|
|
@StateObject private var model = AppViewModel()
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
WatchRootView(model: model)
|
|
.task {
|
|
await model.bootstrap()
|
|
}
|
|
.alert("Something went wrong", isPresented: errorPresented) {
|
|
Button("OK") {
|
|
model.errorMessage = nil
|
|
}
|
|
} message: {
|
|
Text(model.errorMessage ?? "")
|
|
}
|
|
}
|
|
}
|
|
|
|
private var errorPresented: Binding<Bool> {
|
|
Binding(
|
|
get: { model.errorMessage != nil },
|
|
set: { isPresented in
|
|
if !isPresented {
|
|
model.errorMessage = nil
|
|
}
|
|
}
|
|
)
|
|
}
|
|
}
|