|
8 | 8 |
|
9 | 9 | @implementation CodePush {
|
10 | 10 | BOOL _hasResumeListener;
|
| 11 | + BOOL _isFirstRunAfterUpdate; |
11 | 12 | }
|
12 | 13 |
|
13 | 14 | RCT_EXPORT_MODULE()
|
14 | 15 |
|
15 |
| -static BOOL didUpdate = NO; |
16 | 16 | static NSTimer *_timer;
|
17 | 17 | static BOOL usingTestFolder = NO;
|
18 | 18 |
|
@@ -129,7 +129,7 @@ - (void)initializeUpdateAfterRestart
|
129 | 129 | NSDictionary *pendingUpdate = [preferences objectForKey:PendingUpdateKey];
|
130 | 130 |
|
131 | 131 | if (pendingUpdate) {
|
132 |
| - didUpdate = true; |
| 132 | + _isFirstRunAfterUpdate = YES; |
133 | 133 | int rollbackTimeout = [pendingUpdate[PendingUpdateRollbackTimeoutKey] intValue];
|
134 | 134 | if (0 != rollbackTimeout) {
|
135 | 135 | dispatch_async(dispatch_get_main_queue(), ^{
|
@@ -345,7 +345,7 @@ - (void)startRollbackTimer:(int)rollbackTimeout
|
345 | 345 | selector:@selector(loadBundle)
|
346 | 346 | name:UIApplicationWillEnterForegroundNotification
|
347 | 347 | object:[UIApplication sharedApplication]];
|
348 |
| - _hasResumeListener = true; |
| 348 | + _hasResumeListener = YES; |
349 | 349 | }
|
350 | 350 | }
|
351 | 351 | // Signal to JS that the update has been applied.
|
@@ -375,7 +375,7 @@ - (void)startRollbackTimer:(int)rollbackTimeout
|
375 | 375 | rejecter:(RCTPromiseRejectBlock)reject)
|
376 | 376 | {
|
377 | 377 | NSError *error;
|
378 |
| - BOOL isFirstRun = didUpdate |
| 378 | + BOOL isFirstRun = _isFirstRunAfterUpdate |
379 | 379 | && nil != packageHash
|
380 | 380 | && [packageHash length] > 0
|
381 | 381 | && [packageHash isEqualToString:[CodePushPackage getCurrentPackageHash:&error]];
|
|
0 commit comments