From f6263aad5bb41f61c534b1e385abdc87e59b4115 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Sat, 31 Mar 2018 15:09:30 +0200 Subject: [PATCH 1/3] U4-11167 wrap syncTree method to handle rare occasions where it is not defined yet --- .../src/common/services/navigation.service.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 20e73f9e06..094e43676b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -288,9 +288,12 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo throw "args.tree cannot be null"; } - if (mainTreeEventHandler) { - //returns a promise - return mainTreeEventHandler.syncTree(args); + if (mainTreeEventHandler) { + //returns a promise, but wrap it in a time out, + // on some occasions the syncTree method is not defined yet in the umb - tree directive(U4 - 11167) + $timeout(function () { + return mainTreeEventHandler.syncTree(args); + }, 50, false); } //couldn't sync From 27b19a0a3392865fc656f2e7194197858048efda Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Tue, 3 Apr 2018 07:37:37 +0200 Subject: [PATCH 2/3] U4-11167 only wrap in time out when syncTree method is undefined --- .../src/common/services/navigation.service.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 094e43676b..04d5dc4774 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -289,11 +289,17 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo } if (mainTreeEventHandler) { - //returns a promise, but wrap it in a time out, - // on some occasions the syncTree method is not defined yet in the umb - tree directive(U4 - 11167) - $timeout(function () { + + if (mainTreeEventHandler.syncTree) { + //returns a promise, return mainTreeEventHandler.syncTree(args); - }, 50, false); + } else { + //returns a promise, but wrap it in a time out, + // on some occasions the syncTree method is not defined yet in the umb - tree directive(U4 - 11167) + $timeout(function () { + return mainTreeEventHandler.syncTree(args); + }, 50, false); + } } //couldn't sync From 859cb6ce1a15568064753dfc031a3c6c17326cdd Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Wed, 4 Apr 2018 09:44:29 +0200 Subject: [PATCH 3/3] U4-11167 removed the time out..only check if the syncTree method exists --- .../src/common/services/navigation.service.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 04d5dc4774..f775e35934 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -293,12 +293,6 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo if (mainTreeEventHandler.syncTree) { //returns a promise, return mainTreeEventHandler.syncTree(args); - } else { - //returns a promise, but wrap it in a time out, - // on some occasions the syncTree method is not defined yet in the umb - tree directive(U4 - 11167) - $timeout(function () { - return mainTreeEventHandler.syncTree(args); - }, 50, false); } }