Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 02e556d

Browse files
committed
make isFirstRun a precondition of clearing pending updates in notifyApplicationReady
1 parent 9b00cc9 commit 02e556d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CodePush.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,10 @@ - (void)savePendingUpdate:(NSString *)packageHash
506506
RCT_EXPORT_METHOD(notifyApplicationReady:(RCTPromiseResolveBlock)resolve
507507
rejecter:(RCTPromiseRejectBlock)reject)
508508
{
509-
[CodePush removePendingUpdate];
509+
if (_isFirstRunAfterUpdate) {
510+
[CodePush removePendingUpdate];
511+
}
512+
510513
resolve(nil);
511514
}
512515

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,10 @@ public void isFirstRun(String packageHash, Promise promise) {
539539

540540
@ReactMethod
541541
public void notifyApplicationReady(Promise promise) {
542-
removePendingUpdate();
542+
if (didUpdate) {
543+
removePendingUpdate();
544+
}
545+
543546
promise.resolve("");
544547
}
545548

0 commit comments

Comments
 (0)