diff --git a/lib/gui/app/components/file-selector/controllers/file-selector.js b/lib/gui/app/components/file-selector/controllers/file-selector.js index 2968cf0e..342448d8 100644 --- a/lib/gui/app/components/file-selector/controllers/file-selector.js +++ b/lib/gui/app/components/file-selector/controllers/file-selector.js @@ -18,6 +18,8 @@ const os = require('os') const settings = require('../../../models/settings') +const utils = require('../../../../../shared/utils') +const angular = require('angular') /* eslint-disable lodash/prefer-lodash-method */ @@ -46,12 +48,12 @@ module.exports = function ( * @example * FileSelectorController.getFolderConstraint() */ - this.getFolderConstraints = () => { + this.getFolderConstraints = utils.memoize(() => { // TODO(Shou): get this dynamically from the mountpoint of a specific port in Etcher Pro return settings.has('fileBrowserConstraintPath') ? settings.get('fileBrowserConstraintPath').split(',') : [] - } + }, angular.equals) /** * @summary Get initial path