fix(gui): Fix an inifinite digest loop trigger

This fixes a guard against infinite digest loop triggering
that was erronously dropped during a rebase.

Change-Type: patch
This commit is contained in:
Jonas Hermsmeier 2018-05-30 20:34:38 +02:00
parent e8fa7d8812
commit fffdeb1320
No known key found for this signature in database
GPG Key ID: 1B870F801A0CEE9F

View File

@ -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