From ecbb9438bc02f5a2d67ea75c96e24ac65ce90068 Mon Sep 17 00:00:00 2001 From: Nishanth T Date: Tue, 3 Nov 2020 21:20:03 +0530 Subject: [PATCH] changes made in CoreLoadRequest passed delegate obj to PostAction removed flag and check changed Actions to PostAction --- .../MVMCoreLoadRequestOperation.m | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 8399310..4209310 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -779,12 +779,12 @@ if ([loadObject.operation checkAndHandleForCancellation]) { return; } - + DelegateObject *delegateObject = nil; // Show any alerts that we have been saving. if (loadObject.operation.alertToShow) { // If we have an alert to show and a loaded view controller, allow the loaded view controller to be the delegate. - DelegateObject *delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject; + delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject; [MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:loadObject.operation.errorForAlertToShow delegateObject:delegateObject]; } @@ -796,9 +796,10 @@ } //make post load calls function - [MVMCoreLoadRequestOperation loadCallActions:loadObject]; + [MVMCoreLoadRequestOperation loadPostCallActions:loadObject]; + [MVMCoreLoadRequestOperation loadPostAction:loadObject delegateObject:delegateObject]; - [loadObject.operation markAsFinished]; + [loadObject.operation markAsFinished]; } @@ -819,14 +820,10 @@ } } -+ (void)loadCallActions:(nonnull MVMCoreLoadObject *)loadObject { - NSDictionary *actionDict = [loadObject.responseJSON dict:@"Actions"]; ++ (void)loadPostAction:(nonnull MVMCoreLoadObject *)loadObject delegateObject:(nullable DelegateObject *)delegateObject { + NSDictionary *actionDict = [loadObject.responseJSON dict:@"PostAction"]; if (actionDict) { - BOOL shouldTriggerFromCache = [actionDict boolForKey:@"shouldTriggerFromCache"]; - //Check if page is not from cache - if (!loadObject.pageDataFromCache || shouldTriggerFromCache) { - [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionDict additionalData:nil delegateObject:nil]; - } + [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionDict additionalData:nil delegateObject:delegateObject]; } }