Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit df909cf

Browse files
committed
oops
1 parent e1edb83 commit df909cf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

CodePush.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,19 @@ function codePushify(options = {}) {
430430
let rootComponentInstance = this.refs.rootComponent;
431431

432432
let syncStatusCallback;
433-
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange && rootComponentInstance instanceof React.Component) {
434-
syncStatusCallback = rootComponentInstance.codePushStatusDidChange.bind(rootComponentInstance);
433+
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange) {
434+
syncStatusCallback = rootComponentInstance.codePushStatusDidChange;
435+
if (rootComponentInstance instanceof React.Component) {
436+
syncStatusCallback = syncStatusCallback.bind(rootComponentInstance);
437+
}
435438
}
436439

437440
let downloadProgressCallback;
438-
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress && rootComponentInstance instanceof React.Component) {
439-
downloadProgressCallback = rootComponentInstance.codePushDownloadDidProgress.bind(rootComponentInstance);
441+
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress) {
442+
downloadProgressCallback = rootComponentInstance.codePushDownloadDidProgress;
443+
if (rootComponentInstance instanceof React.Component) {
444+
downloadProgressCallback = downloadProgressCallback.bind(rootComponentInstance);
445+
}
440446
}
441447

442448
CodePush.sync(options, syncStatusCallback, downloadProgressCallback);

0 commit comments

Comments
 (0)