diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m index f50e6a5..73b5713 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m @@ -295,9 +295,10 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; -- (void)addPageToPersistentCache:(nonnull NSDictionary *)jsonDictionary pageType:(nonnull NSString *)pageType expirationDate:(nonnull NSDate *)expirationDate isApplicationLevel:(BOOL)isApplicationLevel { +- (void)addPageToPersistentCache:(nonnull NSDictionary *)jsonDictionary pageType:(nonnull NSString *)pageType expirationDate:(nonnull NSDate *)expirationDate{ + NSError *error = nil; - [[PersistentCacheManager shared] saveWithData:jsonDictionary forKey:pageType path:[self getPathForPersistentCachePage:pageType isAppLevel:isApplicationLevel] expirationDate:expirationDate error:&error]; + [[PersistentCacheManager shared] saveWithData:jsonDictionary forKey:pageType path:[self getPathForPersistentCachePage:pageType isAppLevel:[self shouldPersistentlyCacheJSON:jsonDictionary]] expirationDate:expirationDate error:&error]; if (error) { [[MVMCoreLoggingHandler sharedLoggingHandler] addErrorToLog:[MVMCoreErrorObject createErrorObjectForNSError:error location:[NSString stringWithFormat:@"%s_%@",__PRETTY_FUNCTION__,pageType]]]; } @@ -345,7 +346,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt"; return; } - [self addPageToPersistentCache:jsonDictionary pageType:pageType expirationDate:[self getExpirationDateForJSON:jsonDictionary] isApplicationLevel:[self shouldSaveAtAppLevel:jsonDictionary]]; + [self addPageToPersistentCache:jsonDictionary pageType:pageType expirationDate:[self getExpirationDateForJSON:jsonDictionary]]; } } if (completionBlock) {