From b7da4dfeda55ff058694d5b0fa0115810260ff14 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 18 Jan 2016 13:46:29 -0400 Subject: [PATCH] Autoselect the drive if only one drive is present --- build/browser/app.js | 6 ++++++ lib/browser/app.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build/browser/app.js b/build/browser/app.js index b0e36ba4..fdf6f09f 100644 --- a/build/browser/app.js +++ b/build/browser/app.js @@ -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(); diff --git a/lib/browser/app.js b/lib/browser/app.js index 264ab437..82c366ac 100644 --- a/lib/browser/app.js +++ b/lib/browser/app.js @@ -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();