remove existing labels on an item before assigning a new set

This commit is contained in:
Satindar Dhillon 2022-08-05 06:32:40 -07:00
parent 16fa403201
commit 609aff48fc

View file

@ -61,6 +61,11 @@ struct InternalLinkedItem {
linkedItem.contentReader = contentReader
linkedItem.originalHtml = originalHtml
// Remove existing labels in case a label had been deleted
if let existingLabels = linkedItem.labels {
linkedItem.removeFromLabels(existingLabels)
}
for label in labels {
linkedItem.addToLabels(label.asManagedObject(inContext: context))
}