@@ -388,7 +388,7 @@ protected Void doInBackground(Void... params) {
388388 // if the current activity is backgrounded, we want to reload the bundle when
389389 // it comes back into the foreground.
390390 installMode == CodePushInstallMode .IMMEDIATE .getValue ()) {
391-
391+
392392 // Store the minimum duration on the native module as an instance
393393 // variable instead of relying on a closure below, so that any
394394 // subsequent resume-based installs could override it.
@@ -401,15 +401,19 @@ protected Void doInBackground(Void... params) {
401401
402402 @ Override
403403 public void onHostResume () {
404- // Determine how long the app was in the background and ensure
405- // that it meets the minimum duration amount of time.
406- long durationInBackground = 0 ;
407- if (lastPausedDate != null ) {
408- durationInBackground = (new Date ().getTime () - lastPausedDate .getTime ()) / 1000 ;
409- }
410-
411- if (durationInBackground >= CodePushNativeModule .this .mMinimumBackgroundDuration ) {
404+ if (installMode == CodePushInstallMode .IMMEDIATE .getValue ()) {
412405 loadBundle ();
406+ } else {
407+ // Determine how long the app was in the background and ensure
408+ // that it meets the minimum duration amount of time.
409+ long durationInBackground = 0 ;
410+ if (lastPausedDate != null ) {
411+ durationInBackground = (new Date ().getTime () - lastPausedDate .getTime ()) / 1000 ;
412+ }
413+
414+ if (durationInBackground >= CodePushNativeModule .this .mMinimumBackgroundDuration ) {
415+ loadBundle ();
416+ }
413417 }
414418 }
415419
0 commit comments