mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
note cache refactoring WIP
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user