Михаил Капелько 10 månader sedan
förälder
incheckning
7173a79e98
3 ändrade filer med 7 tillägg och 4 borttagningar
  1. +1
    -1
      Modules/MicX/Mic/src/Mic.C.swift
  2. +1
    -1
      Modules/MicX/Mic/src/Mic.Shoulds.swift
  3. +5
    -2
      src/App.swift

+ 1
- 1
Modules/MicX/Mic/src/Mic.C.swift Visa fil

@@ -1,5 +1,5 @@
public extension Mic {
enum C {
static let activityTimeout = 5
static let activityTimeout: TimeInterval = 5
}
}

+ 1
- 1
Modules/MicX/Mic/src/Mic.Shoulds.swift Visa fil

@@ -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.


+ 5
- 2
src/App.swift Visa fil

@@ -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(


Laddar…
Avbryt
Spara