@@ -388,7 +388,7 @@ protected Void doInBackground(Void... params) {
388
388
// if the current activity is backgrounded, we want to reload the bundle when
389
389
// it comes back into the foreground.
390
390
installMode == CodePushInstallMode .IMMEDIATE .getValue ()) {
391
-
391
+
392
392
// Store the minimum duration on the native module as an instance
393
393
// variable instead of relying on a closure below, so that any
394
394
// subsequent resume-based installs could override it.
@@ -401,15 +401,19 @@ protected Void doInBackground(Void... params) {
401
401
402
402
@ Override
403
403
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 ()) {
412
405
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
+ }
413
417
}
414
418
}
415
419
0 commit comments