mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
smaller refactorings continued
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const Entity = require('./entity');
|
||||
const protected_session = require('../services/protected_session');
|
||||
const utils = require('../services/utils');
|
||||
const repository = require('../services/repository');
|
||||
|
||||
class NoteRevision extends Entity {
|
||||
@@ -21,6 +22,10 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.noteRevisionId) {
|
||||
this.noteRevisionId = utils.newNoteRevisionId();
|
||||
}
|
||||
|
||||
if (this.isProtected) {
|
||||
protected_session.encryptNoteRevision(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user