Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function restartApp() {
// eslint-disable-next-line new-cap
CodePush.restartApp();
}
instance.install(codePush.InstallMode.IMMEDIATE).then(() => {
console.log("安装完成");
codePush.notifyAppReady();
codePush.allowRestart();
codePush.restartApp(true);
}).catch(reason => {
CheckCodePushUpdateUtil.error();
restartApp() {
return CodePush.restartApp(false);
},
this.setState({ syncMessage: 'Downloading package.' });
break;
case CodePush.SyncStatus.AWAITING_USER_ACTION:
this.setState({ syncMessage: 'Awaiting user action.' });
break;
case CodePush.SyncStatus.INSTALLING_UPDATE:
this.setState({ syncMessage: 'Installing update.' });
break;
case CodePush.SyncStatus.UP_TO_DATE:
this.setState({ syncMessage: 'App up to date.', progress: false });
break;
case CodePush.SyncStatus.UPDATE_IGNORED:
this.setState({ syncMessage: 'Update cancelled by user.', progress: false });
break;
case CodePush.SyncStatus.UPDATE_INSTALLED:
CodePush.restartApp(false);
this.setState({ syncMessage: 'Update installed and will be applied on restart.', progress: false });
break;
case CodePush.SyncStatus.UNKNOWN_ERROR:
this.setState({ syncMessage: 'An unknown error occurred.', progress: false });
break;
}
}
this.setState({ showUpdate: false, }, () => {
CodePush.restartApp(true);
});
}}