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 +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -428,8 +428,17 @@ function codePushify(options = {}) {
428
428
CodePush . notifyAppReady ( ) ;
429
429
} else {
430
430
let rootComponentInstance = this . refs . rootComponent ;
431
- let syncStatusCallback = rootComponentInstance && rootComponentInstance . codePushStatusDidChange ;
432
- let downloadProgressCallback = rootComponentInstance && rootComponentInstance . codePushDownloadDidProgress ;
431
+
432
+ let syncStatusCallback ;
433
+ if ( rootComponentInstance && rootComponentInstance . codePushStatusDidChange ) {
434
+ syncStatusCallback = rootComponentInstance . codePushStatusDidChange . bind ( rootComponentInstance ) ;
435
+ }
436
+
437
+ let downloadProgressCallback ;
438
+ if ( rootComponentInstance && rootComponentInstance . codePushDownloadDidProgress ) {
439
+ downloadProgressCallback = rootComponentInstance . codePushDownloadDidProgress . bind ( rootComponentInstance ) ;
440
+ }
441
+
433
442
CodePush . sync ( options , syncStatusCallback , downloadProgressCallback ) ;
434
443
if ( options . checkFrequency === CodePush . CheckFrequency . ON_APP_RESUME ) {
435
444
ReactNative . AppState . addEventListener ( "change" , ( newState ) => {
You can’t perform that action at this time.
0 commit comments