Merge branch 'feature/remove_cached_pagesandmodules' into 'develop'
removed pages and modules from cache based on server input. See merge request BPHV_MIPS/mvm_core!20
This commit is contained in:
commit
9cf84619e6
@ -361,6 +361,9 @@
|
||||
loadObject.pageType = [pageJSON string:KeyPageType];
|
||||
}
|
||||
|
||||
//Remove the pages and modules from cache
|
||||
[self removeCaches:[jsonDictionary dict:@"RemoveCaches"]];
|
||||
|
||||
// Sets the response info map
|
||||
loadObject.responseInfoMap = [jsonDictionary dict:KeyResponseInfo];
|
||||
|
||||
@ -830,6 +833,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)removeCaches:(nullable NSDictionary *)cacheDictionary {
|
||||
|
||||
if (cacheDictionary) {
|
||||
NSArray *pagesToClear = [cacheDictionary array:@"pagesToClear"];
|
||||
NSArray *modulesToClear = [cacheDictionary array:@"modulesToClear"];
|
||||
if (modulesToClear) {
|
||||
[[MVMCoreCache sharedCache] removeJSONForModules:modulesToClear];
|
||||
}
|
||||
[pagesToClear enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[[MVMCoreCache sharedCache] removeJSONForPageType:obj];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Presentation Delegate
|
||||
|
||||
- (void)navigationController:(UINavigationController *)navigationController willDisplayViewController:(UIViewController *)viewController {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user