Skip to content

Commit

Permalink
Editor / Distribution / Properly refresh list link on last one (#7844)
Browse files Browse the repository at this point in the history
Follow up of #7468

Refresh list when user remove the last link of a record. In that case md.link is undefined and we need to reload distributions.
  • Loading branch information
fxprunayre committed Mar 7, 2024
1 parent ae54e18 commit 7e9357f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,12 @@
scope.config = gnRelatedResources;

scope.$watchCollection("md.link", function (n, o) {
if (n && n !== o) {
if (scope.md != null && scope.md.link) {
scope.loadDistributions(scope.md.link);
}
if (scope.md != null && n !== o) {
scope.loadDistributions(scope.md.link);
}
});

if (scope.md != null && scope.md.link) {
if (scope.md != null) {
scope.loadDistributions(scope.md.link);
}
}
Expand Down

0 comments on commit 7e9357f

Please sign in to comment.