module map caching and page map caching. we are going to store the common webPunchOunt_UAD

This commit is contained in:
teegsh2 2024-08-29 10:55:36 +05:30
parent 3c8af09752
commit 884e0988df

View File

@ -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.