mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
entities are now changed only if entity hash changed which will limit number of events emitted
This commit is contained in:
@@ -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", "dateModified", "dateCreated"]; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "dateCreated"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
@@ -66,9 +66,11 @@ class Attribute extends Entity {
|
||||
this.dateCreated = dateUtils.nowDate();
|
||||
}
|
||||
|
||||
this.dateModified = dateUtils.nowDate();
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.dateModified = dateUtils.nowDate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user