Skip to content

Build your personal knowledge base with Trilium Notes

fix not updating attribute if not needed

zadam674172f0b812
diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.js
index 660ef2be43..fbed52df0c 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);