Fix incorrect file constraint path

Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2018-10-17 15:20:08 +02:00
parent 161debb35a
commit 407325b8ce

View File

@ -16,6 +16,7 @@
'use strict'
const _ = require('lodash')
const os = require('os')
const settings = require('../../../models/settings')
const utils = require('../../../../../shared/utils')
@ -65,6 +66,7 @@ module.exports = function (
* <file-selector path="FileSelectorController.getPath()"></file-selector>
*/
this.getPath = () => {
return this.getFolderConstraint() ? '/' : os.homedir()
const constraintFolderPath = this.getFolderConstraint()
return _.isEmpty(constraintFolderPath) ? os.homedir() : constraintFolderPath
}
}