From e29ea847e2ad0352478305104cc79e528af8b6d3 Mon Sep 17 00:00:00 2001 From: Geoffrey Goh Date: Fri, 5 Feb 2016 11:58:33 -0800 Subject: [PATCH] feedback --- CodePush.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CodePush.m b/CodePush.m index d3cd626..85013f0 100644 --- a/CodePush.m +++ b/CodePush.m @@ -57,9 +57,7 @@ static NSString *const PackageIsPendingKey = @"isPending"; NSError *error; NSString *packageFile = [CodePushPackage getCurrentPackageBundlePath:&error]; NSURL *binaryJsBundleUrl = [[NSBundle mainBundle] URLForResource:resourceName withExtension:resourceExtension]; - NSDictionary *binaryFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[binaryJsBundleUrl path] error:nil]; - NSDate *binaryDate = [binaryFileAttributes objectForKey:NSFileModificationDate]; - [self saveBinaryBundleDate:binaryDate]; + [self saveBinaryBundleDate:binaryJsBundleUrl]; NSString *logMessageFormat = @"Loading JS bundle from %@"; @@ -124,10 +122,12 @@ static NSString *const PackageIsPendingKey = @"isPending"; return testConfigurationFlag; } -+ (void)saveBinaryBundleDate:(NSDate *)binaryBundleDate ++ (void)saveBinaryBundleDate:(NSURL *)binaryJsBundleUrl { + NSDictionary *binaryFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[binaryJsBundleUrl path] error:nil]; + NSDate *binaryDate = [binaryFileAttributes objectForKey:NSFileModificationDate]; NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults]; - [preferences setObject:binaryBundleDate forKey:BinaryBundleDateKey]; + [preferences setObject:binaryDate forKey:BinaryBundleDateKey]; [preferences synchronize]; }