diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index 137a3e8..2d38b5a 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -1511,6 +1511,14 @@ final class RemoteStore: ObservableObject { private var pushToStartToken: String? /// Host ids that already have the current push-to-start token (mirrors `liveActivitySentTo`). private var pushToStartSentTo: Set = [] + /// Whether the app is currently foreground. Reported to capable Macs (`ClientMsg.setForeground`) + /// so they know whether to defer to the phone's own Live Activity creation (foreground) or + /// push-to-start the glance themselves (backgrounded โ€” the phone can't reliably start one). Starts + /// `true`: `onAppear` runs in the foreground; the background adopt-wake flips it first (ยง5.3). + private var isForeground = true + /// Host ids already told the *current* `isForeground` value โ€” cleared whenever it flips so the + /// next sync re-notifies every host (mirrors `pushToStartSentTo`). + private var foregroundSentTo: Set = [] /// Guards `setupLiveActivityBridge` โ€” it's called from both `onAppear` and the background adopt /// wake, and installing the callbacks / observers once is enough.