mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 16:25:51 +01:00
fix encrypting new notes
This commit is contained in:
@@ -17,9 +17,7 @@ class Entity {
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (!this[this.constructor.primaryKeyName]) {
|
||||
this[this.constructor.primaryKeyName] = utils.newEntityId();
|
||||
}
|
||||
this.generateIdIfNecessary();
|
||||
|
||||
const origHash = this.hash;
|
||||
|
||||
@@ -28,6 +26,12 @@ class Entity {
|
||||
this.isChanged = origHash !== this.hash;
|
||||
}
|
||||
|
||||
generateIdIfNecessary() {
|
||||
if (!this[this.constructor.primaryKeyName]) {
|
||||
this[this.constructor.primaryKeyName] = utils.newEntityId();
|
||||
}
|
||||
}
|
||||
|
||||
generateHash() {
|
||||
let contentToHash = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user