Adjust Push Notification Logic
Nucleic-Session: 0F065CD6-20FE-4941-ACF5-C57A4572A5A3 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -773,6 +773,17 @@ final class RemoteStore: ObservableObject {
|
||||
/// Activity summary. `sessions`/`liveSessions` are already the merged aggregate.
|
||||
private func refreshAggregate() {
|
||||
NotificationRouter.shared.updateBadge(needsYouCount)
|
||||
// When no session is blocked on an approval anymore, recall the "waiting for your approval"
|
||||
// wake tickle a prior push may have left on the lock screen. Complements the relay's silent
|
||||
// clear (which covers phones that were away): this catches the phone that saw the tickle and
|
||||
// then connected, so the resolution arrives as a broadcast rather than a push. Idempotent —
|
||||
// a no-op when the tickle isn't there. Per-approval locals are withdrawn as each resolves.
|
||||
let approvalsPending = liveSessions.contains {
|
||||
$0.pendingApprovalCount > 0 || $0.status == .awaitingApproval
|
||||
}
|
||||
if !approvalsPending {
|
||||
NotificationRouter.shared.withdrawApprovalAttention()
|
||||
}
|
||||
LiveActivityManager.shared.sync(hostName: hostName, sessions: liveSessions)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user