Compare to 0 to get the desired result
This commit is contained in:
@@ -166,8 +166,8 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
|
||||
angular.isArray(Umbraco.Sys.ServerVariables.umbracoPlugins.trees)) {
|
||||
|
||||
var found = _.find(Umbraco.Sys.ServerVariables.umbracoPlugins.trees, function (item) {
|
||||
// localeCompare returns 0 when strings are equal so we need to add one to make it true.
|
||||
return item.alias.localeCompare(treeAlias, undefined, { ignorePunctuation: true }) + 1;
|
||||
// localeCompare returns 0 when strings are equal, so return false if there's no match
|
||||
return item.alias.localeCompare(treeAlias, undefined, { ignorePunctuation: true }) !== 0;
|
||||
});
|
||||
|
||||
return found ? found.packageFolder : undefined;
|
||||
|
||||
Reference in New Issue
Block a user