Skip to content

Build your personal knowledge base with Trilium Notes

fix validation issue + attribute not triggering change event on delete

azivnerf071d3f6510a
diff --git a/src/entities/attribute.js b/src/entities/attribute.js
index c478ffaf8d..4fbbdd396a 100644
--- a/src/entities/attribute.js
+++ b/src/entities/attribute.js
@@ -8,7 +8,7 @@ const sql = require('../services/sql');
class Attribute extends Entity {
static get tableName() { return "attributes"; }
static get primaryKeyName() { return "attributeId"; }
- static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "dateCreated"]; }
+ static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "dateCreated"]; }
constructor(row) {
super(row);
diff --git a/src/public/javascripts/dialogs/attributes.js b/src/public/javascripts/dialogs/attributes.js
index d8a8fad088..fa192ff4da 100644
--- a/src/public/javascripts/dialogs/attributes.js
+++ b/src/public/javascripts/dialogs/attributes.js
@@ -227,7 +227,7 @@ function AttributesModel() {
this.isEmptyName = function(index) {
const cur = self.ownedAttributes()[index]();
- return cur.name.trim() === "" && (cur.attributeId !== "" || cur.labelValue !== "" || cur.relationValue);
+ return cur.name.trim() === "" && !cur.isDeleted && (cur.attributeId !== "" || cur.labelValue !== "" || cur.relationValue);
};
this.getTargetAttribute = function(target) {