fix note cache record for newly created/updated protected notes

This commit is contained in:
azivner 2018-08-28 19:22:46 +02:00
parent 3ad7db39dd
commit 9cfa2ab1ba

View file

@ -6,8 +6,8 @@ const protectedSessionService = require('./protected_session');
const utils = require('./utils');
let loaded = false;
let noteTitles;
let protectedNoteTitles;
let noteTitles = {};
let protectedNoteTitles = {};
let noteIds;
let childParentToBranchId = {};
const childToParent = {};
@ -247,7 +247,14 @@ eventService.subscribe(eventService.ENTITY_CHANGED, async ({entityName, entity})
delete childToParent[note.noteId];
}
else {
noteTitles[note.noteId] = note.title;
if (note.isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) {
protectedNoteTitles[note.noteId] = protectedSessionService.decryptNoteTitle(note.noteId, note.title);
}
}
else {
noteTitles[note.noteId] = note.title;
}
}
}
else if (entityName === 'branches') {