From 674172f0b8128e19c6b7d95e537eb2b45218f616 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 26 Oct 2021 20:57:45 +0200 Subject: [PATCH] fix not updating attribute if not needed --- src/routes/api/attributes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.js index 660ef2be4..fbed52df0 100644 --- a/src/routes/api/attributes.js +++ b/src/routes/api/attributes.js @@ -125,11 +125,13 @@ function updateNoteAttributes(req) { for (const incAttr of incomingAttributes) { position += 10; + const value = incAttr.value || ""; + const perfectMatchAttr = existingAttrs.find(attr => attr.type === incAttr.type && attr.name === incAttr.name && attr.isInheritable === incAttr.isInheritable && - attr.value === incAttr.value); + attr.value === value); if (perfectMatchAttr) { existingAttrs = existingAttrs.filter(attr => attr.attributeId !== perfectMatchAttr.attributeId);