|
|
@@ -121,9 +121,7 @@ async codePushUpdate() { |
|
|
|
this.codePushStatusDidChange.bind(this), |
|
|
|
this.codePushDownloadDidProgress.bind(this) |
|
|
|
).then((status: SyncStatus) => { |
|
|
|
if(status!=CodePush.SyncStatus.UP_TO_DATE){ |
|
|
|
CodePush.restartApp(); |
|
|
|
} |
|
|
|
|
|
|
|
}, (error: any) => { |
|
|
|
CodePush.restartApp(); |
|
|
|
}); |
|
|
@@ -153,6 +151,7 @@ codePushStatusDidChange(syncStatus) { |
|
|
|
break; |
|
|
|
case CodePush.SyncStatus.UPDATE_INSTALLED: |
|
|
|
this.setState({ syncMessage: "更新已安装,重启应用后生效", updating: false }); |
|
|
|
CodePush.restartApp(); |
|
|
|
break; |
|
|
|
case CodePush.SyncStatus.UNKNOWN_ERROR: |
|
|
|
this.setState({ syncMessage: "未知错误", updating: false }); |
|
|
|