mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-14 02:14:52 +08:00
oops
This commit is contained in:
14
CodePush.js
14
CodePush.js
@@ -430,13 +430,19 @@ function codePushify(options = {}) {
|
||||
let rootComponentInstance = this.refs.rootComponent;
|
||||
|
||||
let syncStatusCallback;
|
||||
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange && rootComponentInstance instanceof React.Component) {
|
||||
syncStatusCallback = rootComponentInstance.codePushStatusDidChange.bind(rootComponentInstance);
|
||||
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange) {
|
||||
syncStatusCallback = rootComponentInstance.codePushStatusDidChange;
|
||||
if (rootComponentInstance instanceof React.Component) {
|
||||
syncStatusCallback = syncStatusCallback.bind(rootComponentInstance);
|
||||
}
|
||||
}
|
||||
|
||||
let downloadProgressCallback;
|
||||
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress && rootComponentInstance instanceof React.Component) {
|
||||
downloadProgressCallback = rootComponentInstance.codePushDownloadDidProgress.bind(rootComponentInstance);
|
||||
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress) {
|
||||
downloadProgressCallback = rootComponentInstance.codePushDownloadDidProgress;
|
||||
if (rootComponentInstance instanceof React.Component) {
|
||||
downloadProgressCallback = downloadProgressCallback.bind(rootComponentInstance);
|
||||
}
|
||||
}
|
||||
|
||||
CodePush.sync(options, syncStatusCallback, downloadProgressCallback);
|
||||
|
||||
Reference in New Issue
Block a user