From 752d9461e67a1dc8eb70d93c952e1c8b0dd30833 Mon Sep 17 00:00:00 2001 From: "Subramaniam, Ramya" Date: Mon, 10 Jun 2019 19:14:17 +0530 Subject: [PATCH] Updating review comments --- .../MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 22be088..ce35730 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -854,12 +854,14 @@ + (void)loadPostCallActions:(nonnull MVMCoreLoadObject *)loadObject { - NSDictionary *postCallsDict = [loadObject.pageJSON dictionaryForKey:@"postLoadActions"]; - if (postCallsDict.count > 0) { - NSArray *actionList = [postCallsDict arrayForKey:@"actionList"]; + NSDictionary *postCallsDict = [loadObject.pageJSON dict:@"postLoadActions"]; + if (postCallsDict) { + NSArray *actionList = [postCallsDict array:@"actionList"]; BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"]; //Needs further enhancements based on the flags. - if (isConcurrent) { + BOOL shouldTriggerFromCache = [postCallsDict boolForKey:@"shouldTriggerFromCache"]; + //Check if page is not from cache + if (!shouldTriggerFromCache && !loadObject.pageDataFromCache) { [actionList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:obj additionalData:nil delegateObject:nil]; }];