make isFirstRun a precondition of clearing pending updates in notifyApplicationReady

This commit is contained in:
Geoffrey Goh
2016-02-05 18:30:29 -08:00
parent 9b00cc93e7
commit 02e556d73d
2 changed files with 8 additions and 2 deletions

View File

@@ -506,7 +506,10 @@ RCT_EXPORT_METHOD(isFirstRun:(NSString *)packageHash
RCT_EXPORT_METHOD(notifyApplicationReady:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
[CodePush removePendingUpdate];
if (_isFirstRunAfterUpdate) {
[CodePush removePendingUpdate];
}
resolve(nil);
}