From c425632e272685e3f82a4a051f6ce231ebeaa5ee Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 1 Jul 2016 10:56:30 -0400 Subject: [PATCH] minifix(GUI): use close() to dismiss drive selector modal (#550) Using `dismiss()` causes the promise to be rejected, with no reason in this case. Given we made sure we were handling errors from dialogs in a previous commit, this issue manifested itself. The `close()` function, without arguments, makes more sense in this case. See: https://github.com/resin-io/etcher/pull/548 Signed-off-by: Juan Cruz Viotti --- lib/gui/app.js | 4 ++++ .../components/drive-selector/controllers/drive-selector.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/gui/app.js b/lib/gui/app.js index fa2e36a6..3abbd3f6 100644 --- a/lib/gui/app.js +++ b/lib/gui/app.js @@ -214,6 +214,10 @@ app.controller('AppController', function( }; this.selectDrive = (drive) => { + if (!drive) { + return; + } + this.selection.setDrive(drive); AnalyticsService.logEvent('Select drive', { diff --git a/lib/gui/components/drive-selector/controllers/drive-selector.js b/lib/gui/components/drive-selector/controllers/drive-selector.js index 6e8fa0b5..8ec1a003 100644 --- a/lib/gui/components/drive-selector/controllers/drive-selector.js +++ b/lib/gui/components/drive-selector/controllers/drive-selector.js @@ -56,7 +56,7 @@ module.exports = function($uibModalInstance, DrivesModel, SelectionStateModel) { // is resolved with a non-existent drive. if (!selectedDrive || !_.includes(this.drives.getDrives(), selectedDrive)) { - $uibModalInstance.dismiss(); + $uibModalInstance.close(); } else { $uibModalInstance.close(selectedDrive); }