Deploy Ladill Mini / deploy (push) Successful in 35s
Ship full-featured mobile clients with auth, payments, QRs, push notifications, and iOS polish including Figtree typography, app icons, and QR previews. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.2 KiB
Swift
35 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct LadillMiniApp: App {
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
|
@StateObject private var session = SessionStore.shared
|
|
@Environment(\.scenePhase) private var scenePhase
|
|
@State private var locked = false
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
AppRouter()
|
|
.environmentObject(session)
|
|
.environmentObject(PushNotificationRouter.shared)
|
|
.font(.ladill(16))
|
|
.preferredColorScheme(.light)
|
|
.task {
|
|
if session.isLoggedIn {
|
|
await PushTokenRegistrar.registerIfLoggedIn()
|
|
}
|
|
}
|
|
.overlay {
|
|
if locked && session.isLoggedIn && PinStore.shared.hasPin() {
|
|
PinLockOverlay(onUnlocked: { locked = false })
|
|
}
|
|
}
|
|
.onChange(of: scenePhase) { _, phase in
|
|
if phase == .background && session.isLoggedIn && PinStore.shared.hasPin() {
|
|
locked = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|