This commit is contained in:
Scott Pfeil 2022-09-20 17:29:38 -04:00
parent 3ecd769f1c
commit 793e64143d

View File

@ -13,11 +13,12 @@ open class ActionOpenPageHandler: MVMCoreJSONActionHandlerProtocol {
open func performAction(with JSON: [AnyHashable : Any], model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
guard let model = model as? ActionOpenPageModel else { return }
let requestParameters: MVMCoreRequestParameters = model.requestParameters.copy() as! MVMCoreRequestParameters
do {
if let closure = delegateObject?.actionDelegate?.handleOpenPage {
// Legacy code will use the old handler function and break the task chain here.
closure(model.requestParameters, JSON, additionalData)
} else if let operation = try await performRequestAddingClientParameters(with: model.requestParameters, model: model, delegateObject: delegateObject, additionalData: additionalData) {
closure(requestParameters, JSON, additionalData)
} else if let operation = try await performRequestAddingClientParameters(with: requestParameters, model: model, delegateObject: delegateObject, additionalData: additionalData) {
await withCheckedContinuation { continuation in
operation.completionBlock = {
continuation.resume()