Files
swiftapp/swift/WatchApp/App/IDPGlobalWatchApp.swift
T
jkunz a6939453f8
CI / test (push) Has been cancelled
Adopt root-level tsswift app layout
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.
2026-04-19 01:21:43 +02:00

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
}
}
)
}
}