Skip to content

Commit

Permalink
Merge pull request balena-io#2376 from resin-io/fix-infinite-digest
Browse files Browse the repository at this point in the history
fix(gui): Fix an inifinite digest loop trigger
  • Loading branch information
jhermsmeier committed May 31, 2018
2 parents e8fa7d8 + fffdeb1 commit 7208ad6
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -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 */

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7208ad6

Please sign in to comment.