Spell check For AppLevel key

This commit is contained in:
mayur nilwant 2024-06-13 21:30:33 -04:00
parent b0631d1434
commit 40106d3a9c
3 changed files with 7 additions and 3 deletions

View File

@ -139,7 +139,7 @@ extension PersistentCacheManager {
@objc func shouldSaveAtAppLevel(infoDictionary:[String: AnyHashable]) -> Bool {
guard let cachePolicy = infoDictionary[KeyCachePolicy] as? Dictionary<String, Any>,
let appLevelKey = cachePolicy[KeyAppVelelCachePolicy] as? Bool,
let appLevelKey = cachePolicy[KeyAppLevelCachePolicy] as? Bool,
appLevelKey == true,
self.shouldCachePageJSON(infoDictionary, pageType: PageTypeOfflineFeedback) == true,
self.isJSONExpired(infoDictionary) == false else {return false}

View File

@ -14,7 +14,7 @@
extern NSString * _Nonnull const KeyCachePolicy;
extern NSString * _Nonnull const KeyCacheExpiry;
extern NSString * _Nonnull const KeyAppVelelCachePolicy;
extern NSString * _Nonnull const KeyAppLevelCachePolicy;
extern NSString * _Nonnull const PageTypeOfflineFeedback;

View File

@ -19,7 +19,7 @@
NSString * _Nonnull const KeyCachePolicy = @"cachePolicy";
NSString * _Nonnull const KeyCacheExpiry = @"expiry";
NSString * _Nonnull const KeyAppVelelCachePolicy = @"applicationLevelCache";
NSString * _Nonnull const KeyAppLevelCachePolicy = @"applicationLevelCache";
NSString * _Nonnull const PageTypeOfflineFeedback = @"offlineFeedback";
@ -324,6 +324,10 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
// Adds json to cache with page type key.
[weakSelf.pageTypeCache setObject:jsonDictionary forKey:pageType];
NSLog(@"Page Type is offline: %@", pageType);
if ([pageType isEqualToString:@"offlineFeedback"]) {
NSLog(@"Offline");
}
if (![self shouldPersistentlyCachePage:jsonDictionary pageType:pageType]) {
[[PersistentCacheManager shared] removeForKey:pageType error:nil];