Add Usage Metrics

Nucleic-Session: B4F51091-BE3C-42D3-BCDD-8E89E83543D0
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-09 01:50:25 -07:00
co-authored by Nucleic
parent cba241e4e9
commit af972a55a2
@@ -26,7 +26,11 @@ enum QuotaFormat {
} }
static func resetCaption(_ window: WireUsageWindow, now: Date) -> String? { static func resetCaption(_ window: WireUsageWindow, now: Date) -> String? {
guard let resetsAt = window.resetsAt else { return nil } resetCaption(window.resetsAt, now: now)
}
static func resetCaption(_ resetsAt: Date?, now: Date) -> String? {
guard let resetsAt else { return nil }
let remaining = resetsAt.timeIntervalSince(now) let remaining = resetsAt.timeIntervalSince(now)
guard remaining > 0 else { return "resetting…" } guard remaining > 0 else { return "resetting…" }
return "resets in \(duration(remaining))" return "resets in \(duration(remaining))"