diff --git a/lib/gui/pages/main/controllers/main.js b/lib/gui/pages/main/controllers/main.js index 51acb611..95427f21 100644 --- a/lib/gui/pages/main/controllers/main.js +++ b/lib/gui/pages/main/controllers/main.js @@ -20,6 +20,7 @@ const _ = require('lodash'); module.exports = function( $state, + $timeout, DriveScannerService, SelectionStateModel, FlashStateModel, @@ -78,7 +79,14 @@ module.exports = function( DriveScannerService.on('error', handleError); DriveScannerService.on('drives', (drives) => { - this.drives.setDrives(drives); + + // Safely trigger a digest cycle. + // In some cases, AngularJS doesn't aknowledge that the + // available drives list has changed, and incorrectly + // keeps asking the user to "Connect a drive". + $timeout(() => { + this.drives.setDrives(drives); + }); if (_.isEmpty(drives)) { DriveSelectorService.close();