From 818395383a12c78baa46bffb52d5e2172de0298d Mon Sep 17 00:00:00 2001 From: lvbingru Date: Tue, 5 Apr 2016 17:58:12 +0800 Subject: [PATCH] bug fixed --- ios/RCTHotUpdate/RCTHotUpdate.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ios/RCTHotUpdate/RCTHotUpdate.m b/ios/RCTHotUpdate/RCTHotUpdate.m index 4505f98..be086e8 100644 --- a/ios/RCTHotUpdate/RCTHotUpdate.m +++ b/ios/RCTHotUpdate/RCTHotUpdate.m @@ -106,12 +106,13 @@ RCT_EXPORT_MODULE(RCTHotUpdate); NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSMutableDictionary *packageInfo = [[defaults dictionaryForKey:rnHotUpdatePackageInfoKey] mutableCopy]; - NSDictionary *ret = @{ @"downloadRootDir": [RCTHotUpdate downloadDir], - @"packageVersion": [infoDictionary objectForKey:@"CFBundleShortVersionString"], - @"currentVersion": [packageInfo objectForKey:paramCurrentVersion], - @"isFirstTime": [packageInfo objectForKey:paramIsFirstTime], - @"isRolledBack": [packageInfo objectForKey:paramIsRolledBack] - }; + NSMutableDictionary *ret = [@{} mutableCopy]; + ret[@"downloadRootDir"] = [RCTHotUpdate downloadDir]; + ret[@"packageVersion"] = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; + ret[@"currentVersion"] = [packageInfo objectForKey:paramCurrentVersion]; + ret[@"isFirstTime"] = [packageInfo objectForKey:paramIsFirstTime]; + ret[@"isRolledBack"] = [packageInfo objectForKey:paramIsRolledBack]; + if (packageInfo) { // clear isFirstTime and isRolledBack packageInfo[paramIsFirstTime] = @(NO);