From 4017fe3d75e72cf2a4cef1d88d3b28e5f43136e2 Mon Sep 17 00:00:00 2001 From: danielbasedow Date: Sun, 22 May 2016 12:12:52 +0200 Subject: [PATCH] adjust example to test delaying restart --- Examples/CodePushDemoApp/crossplatformdemo.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Examples/CodePushDemoApp/crossplatformdemo.js b/Examples/CodePushDemoApp/crossplatformdemo.js index 7111d1c..d9cc352 100644 --- a/Examples/CodePushDemoApp/crossplatformdemo.js +++ b/Examples/CodePushDemoApp/crossplatformdemo.js @@ -19,8 +19,7 @@ let CodePushDemoApp = React.createClass({ try { return await CodePush.sync( { - updateDialog: true, - installMode: CodePush.InstallMode.ON_NEXT_RESUME + installMode: CodePush.InstallMode.ON_NEXT_RESTART_OPPORTUNITY, }, (syncStatus) => { switch(syncStatus) { @@ -89,6 +88,15 @@ let CodePushDemoApp = React.createClass({ return { }; }, + toggleAllowRestart() { + if (CodePush.restartAllowed()) { + CodePush.disallowRestart(); + } else { + CodePush.allowRestart(); + } + this.forceUpdate(); + }, + render() { let syncView, syncButton, progressView; @@ -119,6 +127,9 @@ let CodePushDemoApp = React.createClass({ {syncView} {progressView} + ); }