From 849619b5574301d2af69440ca9943e8dcc76dce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Thu, 29 Aug 2024 16:46:59 +0200 Subject: [PATCH] Social links in metadata page doesn't have the metadata page permalink. Fixes #8322 --- .../search/mdview/mdviewDirective.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js index 4f9f2e6546c..f91c671e018 100644 --- a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js @@ -588,15 +588,20 @@ }, link: function (scope, element, attrs) { scope.mdService = gnUtilityService; - scope.$watch(scope.md, function (newVal, oldVal) { - if (newVal !== null && newVal !== oldVal) { - $http - .get("../api/records/" + scope.md.getUuid() + "/permalink") - .then(function (r) { - scope.socialMediaLink = r.data; - }); - } - }); + + scope.$watch( + "md", + function (newVal, oldVal) { + if (newVal !== null && newVal !== oldVal) { + $http + .get("../api/records/" + scope.md.getUuid() + "/permalink") + .then(function (r) { + scope.socialMediaLink = r.data; + }); + } + }, + true + ); } }; }