Launch Activity Logic
Nucleic-Session: EBB24271-3AB2-4CBD-A47A-59FC73500371 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -1297,7 +1297,13 @@ final class RemoteStore: ObservableObject {
|
|||||||
/// Host ids that already have the current push-to-start token (mirrors `liveActivitySentTo`).
|
/// Host ids that already have the current push-to-start token (mirrors `liveActivitySentTo`).
|
||||||
private var pushToStartSentTo: Set<String> = []
|
private var pushToStartSentTo: Set<String> = []
|
||||||
|
|
||||||
|
/// 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() {
|
private func setupLiveActivityBridge() {
|
||||||
|
guard !liveActivityBridgeSetup else { return }
|
||||||
|
liveActivityBridgeSetup = true
|
||||||
LiveActivityManager.shared.onPushToken = { [weak self] token, activityID in
|
LiveActivityManager.shared.onPushToken = { [weak self] token, activityID in
|
||||||
guard let self, self.liveActivityReg?.token != token else { return }
|
guard let self, self.liveActivityReg?.token != token else { return }
|
||||||
self.liveActivityReg = (token, activityID)
|
self.liveActivityReg = (token, activityID)
|
||||||
|
|||||||
Reference in New Issue
Block a user