From 278ab0fa8f5bb52ffee9bd2f86c83a7a96129f3c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 20 Jan 2016 14:54:52 -0800 Subject: [PATCH] don't make the dialogs synchronous --- server-console/src/main.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 594f5afddc..d360dbd32c 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -330,27 +330,27 @@ function isStackManagerContentPresent() { } function promptToMigrateContent() { - var idx = dialog.showMessageBox({ + dialog.showMessageBox({ type: 'question', buttons: ['Yes', 'No'], title: 'Migrate Content', message: 'Are you sure?\n\nThis will stop your home server and replace everything in your home with your content from Stack Manager.' - }); + }, function(index) { + if (index == 0) { + if (homeServer.state != ProcessGroupStates.STOPPED) { + homeServer.on('state-update', function(processGroup) { + if (processGroup.state == ProcessGroupStates.STOPPED) { + performContentMigration(); + } + }); - if (idx == 0) { - if (homeServer.state != ProcessGroupStates.STOPPED) { - homeServer.on('state-update', function(processGroup) { - if (processGroup.state == ProcessGroupStates.STOPPED) { - performContentMigration(); - } - }); + homeServer.stop(); - homeServer.stop(); - - } else { - performContentMigration(); + } else { + performContentMigration(); + } } - } + }); } function performContentMigration() { @@ -366,7 +366,7 @@ function performContentMigration() { buttons: ['OK'], title: 'Models File Not Found', message: 'There is no models file at ' + modelsPath + '\n\nStack Manager content migration can not proceed.' - }); + }, null); return; } @@ -381,7 +381,7 @@ function performContentMigration() { buttons: ['OK'], title: 'Migration Complete', message: 'Your Stack Manager content has been migrated.\n\nYour home server will now be restarted.' - }); + }, null); } else { // show error message for copy fail dialog.showMessageBox({ @@ -389,7 +389,7 @@ function performContentMigration() { buttons: ['OK'], title: 'Migration Failed', message: 'There was an error copying your Stack Manager content: ' + copyError + '\n\nPlease try again.' - }); + }, null); } }