mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix duplicate labels
This commit is contained in:
parent
cbb07318e5
commit
7153014a87
1 changed files with 3 additions and 2 deletions
|
|
@ -979,10 +979,11 @@ export const batchUpdateLibraryItems = async (
|
|||
.map((label) => ({
|
||||
labelId: label.id,
|
||||
libraryItemId: libraryItem.id,
|
||||
name: label.name,
|
||||
}))
|
||||
.filter((entityLabel) => {
|
||||
const existingLabel = libraryItem.labels?.find(
|
||||
(l) => l.id === entityLabel.labelId
|
||||
const existingLabel = libraryItem.labelNames?.find(
|
||||
(l) => l.toLowerCase() === entityLabel.name.toLowerCase()
|
||||
)
|
||||
return !existingLabel
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue