From c9ea3656bd8e7f523267088fc554b09626dfd339 Mon Sep 17 00:00:00 2001 From: Rachel Breeze Date: Wed, 2 Oct 2019 20:52:22 +0100 Subject: [PATCH] Added a test for if an empty titlePrefix is passed into the $changeTitle call --- src/Umbraco.Web.UI.Client/src/init.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js index 2fca5b40d2..cd00e1261d 100644 --- a/src/Umbraco.Web.UI.Client/src/init.js +++ b/src/Umbraco.Web.UI.Client/src/init.js @@ -47,7 +47,11 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', var originalTitle = ""; $rootScope.$on('$changeTitle', function (event, titlePrefix) { - $rootScope.locationTitle = titlePrefix + " - " + originalTitle; + if (titlePrefix) { + $rootScope.locationTitle = titlePrefix + " - " + originalTitle; + } else { + $rootScope.locationTitle = originalTitle; + } }); /** execute code on each successful route */