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 <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-07-01 10:56:30 -04:00 committed by GitHub
parent 5e1ee62840
commit c425632e27
2 changed files with 5 additions and 1 deletions

View File

@ -214,6 +214,10 @@ app.controller('AppController', function(
};
this.selectDrive = (drive) => {
if (!drive) {
return;
}
this.selection.setDrive(drive);
AnalyticsService.logEvent('Select drive', {

View File

@ -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);
}