note cache refactoring WIP

This commit is contained in:
zadam
2020-05-17 09:48:24 +02:00
parent dcd371b5b1
commit 60c2049729
14 changed files with 104 additions and 57 deletions

View File

@@ -1,4 +1,8 @@
export default class Note {
"use strict";
const noteCache = require('../note_cache');
class Note {
constructor(row) {
/** @param {string} */
this.noteId = row.noteId;
@@ -29,7 +33,7 @@ export default class Note {
this.flatTextCache = null;
if (protectedSessionService.isProtectedSessionAvailable()) {
decryptProtectedNote(this);
noteCache.decryptProtectedNote(this);
}
}
@@ -233,4 +237,14 @@ export default class Note {
return arr;
}
decrypt() {
if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
this.title = protectedSessionService.decryptString(note.title);
this.isDecrypted = true;
}
}
}
module.exports = Note;