diff --git a/Modules/MicX/Mic/src/Mic.C.swift b/Modules/MicX/Mic/src/Mic.C.swift index e1db88a..19e5788 100644 --- a/Modules/MicX/Mic/src/Mic.C.swift +++ b/Modules/MicX/Mic/src/Mic.C.swift @@ -1,5 +1,5 @@ public extension Mic { enum C { - static let activityTimeout = 5 + static let activityTimeout: TimeInterval = 5 } } diff --git a/Modules/MicX/Mic/src/Mic.Shoulds.swift b/Modules/MicX/Mic/src/Mic.Shoulds.swift index 15e48ee..15cd7bf 100644 --- a/Modules/MicX/Mic/src/Mic.Shoulds.swift +++ b/Modules/MicX/Mic/src/Mic.Shoulds.swift @@ -7,7 +7,7 @@ public extension Mic { /// - Returns: Словарь активных состояний static func shouldResetActivityDates(_ c: MicContext) -> [String: Date]? { if c.activeIds.isRecent { - var ad = c.activityDates + var ad = c.activityDates.value let ids = c.activeIds.value let now = Date() // Задаём абсолютную дату истечения для активных id. diff --git a/src/App.swift b/src/App.swift index e27defc..b3c4651 100644 --- a/src/App.swift +++ b/src/App.swift @@ -12,8 +12,10 @@ struct Content: View { @StateObject var adates = BusUI.Value(Mic.K.activityDates, [String: Date]()) func val(_ k: String) -> String { - let dt = adates.v[k] ?? .distantPast - return String(describing: Int(dt.timeIntervalSince1970)) + if let dt = adates.v[k] { + return String(describing: Int(dt.timeIntervalSince1970)) + } + return "N/A" } var body: some View { @@ -113,6 +115,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate func testMic4() { delayedSend(2, Mic.K.activeIds, ["1"]) delayedSend(5, Mic.K.activeIds, ["1", "4"]) + delayedSend(11, Mic.K.activeIds, ["3", "4"]) } func delayedSend(