File tree 1 file changed +8
-1
lines changed
android/app/src/main/java/com/microsoft/codepush/react
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -233,9 +233,12 @@ private JSONObject getPendingUpdate() {
233
233
}
234
234
235
235
private void initializeUpdateAfterRestart () {
236
+ // Reset the state which indicates that
237
+ // the app was just freshly updated.
238
+ didUpdate = false ;
239
+
236
240
JSONObject pendingUpdate = getPendingUpdate ();
237
241
if (pendingUpdate != null ) {
238
- didUpdate = true ;
239
242
try {
240
243
boolean updateIsLoading = pendingUpdate .getBoolean (PENDING_UPDATE_IS_LOADING_KEY );
241
244
if (updateIsLoading ) {
@@ -245,6 +248,10 @@ private void initializeUpdateAfterRestart() {
245
248
needToReportRollback = true ;
246
249
rollbackPackage ();
247
250
} else {
251
+ // There is in fact a new update running for the first
252
+ // time, so update the local state to ensure the client knows.
253
+ didUpdate = true ;
254
+
248
255
// Mark that we tried to initialize the new update, so that if it crashes,
249
256
// we will know that we need to rollback when the app next starts.
250
257
savePendingUpdate (pendingUpdate .getString (PENDING_UPDATE_HASH_KEY ),
You can’t perform that action at this time.
0 commit comments