mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-21 07:43:31 +00:00
Merge pull request #1691 from sharelatex/cmg-tag-duplicates
Stop duplicate tags being created GitOrigin-RevId: 7e2b4228dc6ec7ebc2a4e30e18a6d5dcbd5cb6c8
This commit is contained in:
parent
9e63211a17
commit
144d936141
1 changed files with 8 additions and 2 deletions
|
@ -403,8 +403,14 @@ define(['base'], function(App) {
|
|||
})
|
||||
|
||||
return modalInstance.result.then(function(tag) {
|
||||
$scope.tags.push(tag)
|
||||
return $scope.addSelectedProjectsToTag(tag)
|
||||
const tagIsDuplicate = $scope.tags.find(function(existingTag) {
|
||||
return tag.name === existingTag.name
|
||||
})
|
||||
|
||||
if (!tagIsDuplicate) {
|
||||
$scope.tags.push(tag)
|
||||
return $scope.addSelectedProjectsToTag(tag)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue