From 393b2f29f40c5fd1e9f75a52a8a02a0514632269 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 14:04:29 -0700 Subject: [PATCH] Launch Activity Logic Nucleic-Session: EBB24271-3AB2-4CBD-A47A-59FC73500371 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/RemoteStore.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index 9bd57b2..f7fe423 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -1297,7 +1297,13 @@ final class RemoteStore: ObservableObject { /// Host ids that already have the current push-to-start token (mirrors `liveActivitySentTo`). private var pushToStartSentTo: Set = [] + /// Guards `setupLiveActivityBridge` — it's called from both `onAppear` and the background adopt + /// wake, and installing the callbacks / observers once is enough. + private var liveActivityBridgeSetup = false + private func setupLiveActivityBridge() { + guard !liveActivityBridgeSetup else { return } + liveActivityBridgeSetup = true LiveActivityManager.shared.onPushToken = { [weak self] token, activityID in guard let self, self.liveActivityReg?.token != token else { return } self.liveActivityReg = (token, activityID)