mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix note cache record for newly created/updated protected notes
This commit is contained in:
parent
3ad7db39dd
commit
9cfa2ab1ba
@ -6,8 +6,8 @@ const protectedSessionService = require('./protected_session');
|
|||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
|
|
||||||
let loaded = false;
|
let loaded = false;
|
||||||
let noteTitles;
|
let noteTitles = {};
|
||||||
let protectedNoteTitles;
|
let protectedNoteTitles = {};
|
||||||
let noteIds;
|
let noteIds;
|
||||||
let childParentToBranchId = {};
|
let childParentToBranchId = {};
|
||||||
const childToParent = {};
|
const childToParent = {};
|
||||||
@ -246,10 +246,17 @@ eventService.subscribe(eventService.ENTITY_CHANGED, async ({entityName, entity})
|
|||||||
delete noteTitles[note.noteId];
|
delete noteTitles[note.noteId];
|
||||||
delete childToParent[note.noteId];
|
delete childToParent[note.noteId];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (note.isProtected) {
|
||||||
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
|
protectedNoteTitles[note.noteId] = protectedSessionService.decryptNoteTitle(note.noteId, note.title);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
noteTitles[note.noteId] = note.title;
|
noteTitles[note.noteId] = note.title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (entityName === 'branches') {
|
else if (entityName === 'branches') {
|
||||||
const branch = entity;
|
const branch = entity;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user