Autoselect the drive if only one drive is present

This commit is contained in:
Juan Cruz Viotti 2016-01-18 13:46:29 -04:00
parent 79ebe75472
commit b7da4dfeda
2 changed files with 12 additions and 0 deletions

View File

@ -53,6 +53,12 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
this.selection.clear();
this.writer.setProgress(0);
this.scanner.start(2000);
this.scanner.scan().then(function (res) {
if(res.length === 1){
self.selectDrive(res[0]);
}
});
};
this.restart();

View File

@ -52,6 +52,12 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState
this.selection.clear();
this.writer.setProgress(0);
this.scanner.start(2000);
this.scanner.scan().then(function (res) {
if(res.length === 1){
self.selectDrive(res[0]);
}
});
};
this.restart();