Push Notification Live Activity Redundancy
Nucleic-Session: 73687ED9-C11C-438C-832B-979332B73893 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -307,13 +307,19 @@ final class LiveActivityManager {
|
|||||||
|
|
||||||
/// Project a wire summary into the widget's self-contained row model.
|
/// Project a wire summary into the widget's self-contained row model.
|
||||||
private static func line(for s: WireSessionSummary) -> NucleicSessionAttributes.SessionLine {
|
private static func line(for s: WireSessionSummary) -> NucleicSessionAttributes.SessionLine {
|
||||||
NucleicSessionAttributes.SessionLine(
|
// Carry the approval id/risk only for a session actually awaiting approval — that's the row
|
||||||
|
// the glance renders inline Allow/Deny on (`ApproveFromActivityIntent`). Other states leave
|
||||||
|
// it nil so the row stays a plain deep-link tap.
|
||||||
|
let approvalID = s.status == .awaitingApproval ? s.firstApprovalID?.rawValue : nil
|
||||||
|
return NucleicSessionAttributes.SessionLine(
|
||||||
id: s.sessionID.rawValue,
|
id: s.sessionID.rawValue,
|
||||||
title: s.title.isEmpty ? s.projectName : s.title,
|
title: s.title.isEmpty ? s.projectName : s.title,
|
||||||
project: s.projectName,
|
project: s.projectName,
|
||||||
backend: backend(s.backend),
|
backend: backend(s.backend),
|
||||||
kind: kind(for: s),
|
kind: kind(for: s),
|
||||||
detail: detail(for: s))
|
detail: detail(for: s),
|
||||||
|
approvalID: approvalID,
|
||||||
|
approvalIsHighRisk: approvalID == nil ? nil : s.firstApprovalIsHighRisk)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func kind(for s: WireSessionSummary) -> NucleicSessionAttributes.Kind {
|
private static func kind(for s: WireSessionSummary) -> NucleicSessionAttributes.Kind {
|
||||||
|
|||||||
Reference in New Issue
Block a user