Cloud Infrastructure Setup
Nucleic-Session: 5AC77C62-A729-42E5-A368-1142C3B9E695
This commit is contained in:
@@ -3,12 +3,21 @@ import SwiftUI
|
|||||||
@main
|
@main
|
||||||
struct NucleicRemoteApp: App {
|
struct NucleicRemoteApp: App {
|
||||||
@StateObject private var store = RemoteStore()
|
@StateObject private var store = RemoteStore()
|
||||||
|
@Environment(\.scenePhase) private var scenePhase
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
RootView()
|
RootView()
|
||||||
.environmentObject(store)
|
.environmentObject(store)
|
||||||
.onAppear { store.onAppear() }
|
.onAppear {
|
||||||
|
store.onAppear()
|
||||||
|
// Anonymous, opt-out, once-a-day DAU heartbeat (docs/CLOUD_INFRA.md §4).
|
||||||
|
Task { await HeartbeatReporter.reportIfDue() }
|
||||||
|
}
|
||||||
|
// Re-check on every foreground so a new active day is counted.
|
||||||
|
.onChange(of: scenePhase) { _, phase in
|
||||||
|
if phase == .active { Task { await HeartbeatReporter.reportIfDue() } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user