autocomplete supports encrypted notes now as well

This commit is contained in:
azivner
2018-04-20 00:12:01 -04:00
parent 8c54b62f07
commit 4ce5ea9886
7 changed files with 100 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
"use strict";
const Entity = require('./entity');
const protected_session = require('../services/protected_session');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
const dateUtils = require('../services/date_utils');
@@ -14,7 +14,7 @@ class Note extends Entity {
// check if there's noteId, otherwise this is a new entity which wasn't encrypted yet
if (this.isProtected && this.noteId) {
protected_session.decryptNote(this);
protectedSessionService.decryptNote(this);
}
this.setContent(this.content);
@@ -146,7 +146,7 @@ class Note extends Entity {
}
if (this.isProtected) {
protected_session.encryptNote(this);
protectedSessionService.encryptNote(this);
}
if (!this.isDeleted) {

View File

@@ -1,8 +1,7 @@
"use strict";
const Entity = require('./entity');
const protected_session = require('../services/protected_session');
const utils = require('../services/utils');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
class NoteRevision extends Entity {
@@ -13,7 +12,7 @@ class NoteRevision extends Entity {
super(row);
if (this.isProtected) {
protected_session.decryptNoteRevision(this);
protectedSessionService.decryptNoteRevision(this);
}
}
@@ -25,7 +24,7 @@ class NoteRevision extends Entity {
super.beforeSaving();
if (this.isProtected) {
protected_session.encryptNoteRevision(this);
protectedSessionService.encryptNoteRevision(this);
}
}
}