Code review comment to pipe polling action through the delegate (controller) first.

This commit is contained in:
Hedden, Kyle Matthew 2024-02-21 18:04:39 -05:00
parent 0f56803a5d
commit 7c9d257a52

View File

@ -88,7 +88,11 @@ public class PollingBehavior: NSObject, PageVisibilityBehavior {
pollTimer?.schedule(deadline: .now() + timeRemaining, repeating: interval)
pollTimer?.setEventHandler(qos:.utility) {
Task {
try? await MVMCoreActionHandler.shared()?.handleAction(with: refreshAction, additionalData: nil, delegateObject: delegateObject)
if let delegateActionHandler = delegateObject?.actionDelegate as? ActionDelegateProtocol {
try? await delegateActionHandler.performAction(with: refreshAction, additionalData: nil, delegateObject: delegateObject)
} else {
try? await MVMCoreActionHandler.shared()?.handleAction(with: refreshAction, additionalData: nil, delegateObject: delegateObject)
}
}
}
pollTimer?.resume()