From 72aa32981c8e7492d62fa85361479b46fda06d9e Mon Sep 17 00:00:00 2001 From: josephheqj <49510685+josephheqj@users.noreply.github.com> Date: Mon, 10 Jun 2024 04:38:13 +1000 Subject: [PATCH] add check for matching the current content node id (#274) Co-authored-by: JosephHe --- .../ContentApps/Content/seoContent.controller.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SeoToolkit.Umbraco.Common/wwwroot/ContentApps/Content/seoContent.controller.js b/src/SeoToolkit.Umbraco.Common/wwwroot/ContentApps/Content/seoContent.controller.js index 3d4aa07b..747f8cad 100644 --- a/src/SeoToolkit.Umbraco.Common/wwwroot/ContentApps/Content/seoContent.controller.js +++ b/src/SeoToolkit.Umbraco.Common/wwwroot/ContentApps/Content/seoContent.controller.js @@ -6,7 +6,7 @@ var vm = this; vm.displays = []; vm.defaultButtonScope = null; - + vm.nodeId = ""; vm.setActive = setActive; function setActive(display) { @@ -21,8 +21,10 @@ } function save() { - $scope.$broadcast("seoContentSubmitting"); - notificationsService.success("SEO content saved!"); + if(vm.nodeId === editorState.current.id){ + $scope.$broadcast("seoContentSubmitting"); + notificationsService.success("SEO content saved!"); + } } function init() { @@ -36,6 +38,8 @@ vm.displays[0].active = true; } }); + + vm.nodeId = editorState.current.id; } unsubscribe.push(eventsService.on("app.tabChange",