mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 16:06:08 +00:00
22 lines
668 B
Swift
22 lines
668 B
Swift
import SwiftUI
|
|
|
|
@main
|
|
struct WarmblyApp: App {
|
|
@UIApplicationDelegateAdaptor(PushAppDelegate.self) private var pushDelegate
|
|
@State private var env = AppEnvironment()
|
|
@AppStorage(AppearancePreference.storageKey) private var appearance = AppearancePreference.standard
|
|
@Environment(\.scenePhase) private var scenePhase
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
RootView()
|
|
.environment(env)
|
|
.tint(WTheme.ink)
|
|
.preferredColorScheme(appearance.colorScheme)
|
|
}
|
|
.onChange(of: scenePhase) { _, phase in
|
|
if phase == .active { env.realtime.nudge() }
|
|
}
|
|
}
|
|
}
|