From 884e0988df0375c04d337921d3813ba86c941ed5 Mon Sep 17 00:00:00 2001 From: teegsh2 Date: Thu, 29 Aug 2024 10:55:36 +0530 Subject: [PATCH] module map caching and page map caching. we are going to store the common webPunchOunt_UAD --- .../LoadHandling/MVMCoreLoadRequestOperation.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 801f2d0..6fb5c28 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -239,8 +239,22 @@ // Check cache function if page json is already in the cache. [[MVMCoreCache sharedCache] fetchJSONForPageType:requestParameters.pageType completionHandler:^(NSDictionary * _Nullable jsonDictionary) { - completionHandler(jsonDictionary,nil); - }]; + if ([requestParameters.pageType isEqualToString:@"webPunchOut_UAD"]) { + NSMutableDictionary *newJsonDictionary = [jsonDictionary mutableCopy]; + NSString *flowName = requestParameters.actionMap[@"extraParameters"][@"flowName"]; + [[MVMCoreCache sharedCache] fetchJSONForModule: flowName completionHandler:^(NSDictionary * _Nullable moduleJsonDictionary) { + if (moduleJsonDictionary[flowName] != NULL && moduleJsonDictionary[flowName][@"browserUrl"] != NULL) { + [newJsonDictionary setObject: moduleJsonDictionary[flowName][@"browserUrl"] forKey:@"browserUrl"]; + completionHandler(newJsonDictionary, nil); + } + }]; + //jsonDictionary[@"browserUrl"] = + } else { + completionHandler(jsonDictionary,nil); + } + }]; + + } else if (modules > 0) { // Check cache function if modules already in the cache.