|
- public extension MicItem {
- static func shouldResetActivity(_ c: MicItemContext) -> Bool? {
- if
- c.activityDate.isRecent,
- let end = c.activityDate.value
- {
- let now = Date()
- return now < end
- }
-
- return nil
- }
-
- static func shouldResetTimeout(_ c: MicItemContext) -> (delay: Int, value: Bool)? {
- if
- c.activityDate.isRecent,
- let end = c.activityDate.value
- {
- let now = Date()
- let timeout = now < end
- return (timeout, true)
- }
-
- return nil
- }
- }
|