From 74f98d51cd9f51a8647119a9aa6f1757fa1c63b8 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 18 Apr 2019 12:37:52 +0200 Subject: [PATCH] Compare to 0 to get the desired result --- src/Umbraco.Web.UI.Client/src/common/services/tree.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js index a593e24bfe..73893739a6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js @@ -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;