Merge pull request #2376 from resin-io/fix-infinite-digest

fix(gui): Fix an inifinite digest loop trigger
This commit is contained in:
Jonas Hermsmeier 2018-05-31 15:01:27 +02:00 committed by GitHub
commit 7208ad67f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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