Add Usage Metrics
Nucleic-Session: B4F51091-BE3C-42D3-BCDD-8E89E83543D0 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -26,7 +26,11 @@ enum QuotaFormat {
|
||||
}
|
||||
|
||||
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)
|
||||
guard remaining > 0 else { return "resetting…" }
|
||||
return "resets in \(duration(remaining))"
|
||||
|
||||
Reference in New Issue
Block a user