d
This commit is contained in:
@@ -8,6 +8,10 @@ public extension MicItem {
|
|||||||
return now < end
|
return now < end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if timeout {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,7 +22,7 @@ public extension MicItem {
|
|||||||
{
|
{
|
||||||
let timeout = end.timeIntervalSinceNow
|
let timeout = end.timeIntervalSinceNow
|
||||||
/**/print("ИГР MicIS.shouldRT timeout: '\(timeout)'")
|
/**/print("ИГР MicIS.shouldRT timeout: '\(timeout)'")
|
||||||
return nil
|
return timeout > 0 ? timeout : nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ import MPAKX
|
|||||||
|
|
||||||
public protocol MicItemContext {
|
public protocol MicItemContext {
|
||||||
var activityDate: MPAK.Recent<Date?> { get }
|
var activityDate: MPAK.Recent<Date?> { get }
|
||||||
|
var timeout: Bool { get }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MicItem {
|
extension MicItem {
|
||||||
public struct Model: MicItemContext {
|
public struct Model: MicItemContext {
|
||||||
public var activityDate: MPAK.Recent<Date?> = .init(nil)
|
public var activityDate: MPAK.Recent<Date?> = .init(nil)
|
||||||
|
public var timeout: Bool = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +39,15 @@ extension MicItem {
|
|||||||
},
|
},
|
||||||
{ m, _ in m.activityDate.isRecent = false }
|
{ m, _ in m.activityDate.isRecent = false }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ctrl.pipe(
|
||||||
|
dbg: "timeout",
|
||||||
|
sub: nil,
|
||||||
|
Bus.events.compactMap { Bus.convertKeyValue(K.timeout, $0) }.map { (k: String, v: Bool) in v }.eraseToAnyPublisher(),
|
||||||
|
{ $0.timeout = true },
|
||||||
|
{ $0.timeout = false }
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user