This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
android/app/src/main/java/com/microsoft/codepush/react Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -233,9 +233,12 @@ private JSONObject getPendingUpdate() {
233233 }
234234
235235 private void initializeUpdateAfterRestart () {
236+ // Reset the state which indicates that
237+ // the app was just freshly updated.
238+ didUpdate = false ;
239+
236240 JSONObject pendingUpdate = getPendingUpdate ();
237241 if (pendingUpdate != null ) {
238- didUpdate = true ;
239242 try {
240243 boolean updateIsLoading = pendingUpdate .getBoolean (PENDING_UPDATE_IS_LOADING_KEY );
241244 if (updateIsLoading ) {
@@ -245,6 +248,10 @@ private void initializeUpdateAfterRestart() {
245248 needToReportRollback = true ;
246249 rollbackPackage ();
247250 } 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+
248255 // Mark that we tried to initialize the new update, so that if it crashes,
249256 // we will know that we need to rollback when the app next starts.
250257 savePendingUpdate (pendingUpdate .getString (PENDING_UPDATE_HASH_KEY ),
You can’t perform that action at this time.
0 commit comments