From bfbdf6de434a6cada8c50cf84aa2609d774d9b74 Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 5 Aug 2019 16:23:51 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=87=E7=BA=A7][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=87=E7=BA=A7=E7=BB=84=E4=BB=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/App.js b/App.js index c4f2862..1e97365 100644 --- a/App.js +++ b/App.js @@ -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 });