diff --git a/NucleicRemote/NucleicRemote/Views/StatusAndQuota.swift b/NucleicRemote/NucleicRemote/Views/StatusAndQuota.swift index a73f198..588e591 100644 --- a/NucleicRemote/NucleicRemote/Views/StatusAndQuota.swift +++ b/NucleicRemote/NucleicRemote/Views/StatusAndQuota.swift @@ -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))"