Push Notification Live Activity Redundancy
Nucleic-Session: 73687ED9-C11C-438C-832B-979332B73893 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -698,8 +698,15 @@ final class RemoteStore: ObservableObject {
|
|||||||
!self.openApprovals.contains(where: { $0.id == req.id }) {
|
!self.openApprovals.contains(where: { $0.id == req.id }) {
|
||||||
self.openApprovals.append(req)
|
self.openApprovals.append(req)
|
||||||
}
|
}
|
||||||
// Post for any host; the router suppresses the banner if the user is on this session.
|
// Prefer the Live Activity: when backgrounded with a glance on screen, the glance itself
|
||||||
NotificationRouter.shared.postApproval(req, sessionTitle: title)
|
// carries the approval (its inline Allow/Deny) and alerts (sound/haptic) via the local
|
||||||
|
// update path — so don't also post a banner. In-app the glance isn't the surface (it
|
||||||
|
// doesn't show over the app that controls it), so the banner is; and if there's no glance
|
||||||
|
// at all (Live Activities off) the banner is the only surface, so keep it as the fallback.
|
||||||
|
// willPresent still suppresses the banner when the user is already on this session.
|
||||||
|
if isForeground || !LiveActivityManager.shared.hasLiveActivity {
|
||||||
|
NotificationRouter.shared.postApproval(req, sessionTitle: title)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cb.approvalResolved = { [weak self] resolved in
|
cb.approvalResolved = { [weak self] resolved in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
|
|||||||
Reference in New Issue
Block a user