mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
updating the note cache after sync
This commit is contained in:
@@ -2,6 +2,7 @@ const sql = require('./sql');
|
||||
const log = require('./log');
|
||||
const eventLogService = require('./event_log');
|
||||
const syncTableService = require('./sync_table');
|
||||
const eventService = require('./events');
|
||||
|
||||
async function updateEntity(sync, entity, sourceId) {
|
||||
const {entityName} = sync;
|
||||
@@ -36,6 +37,15 @@ async function updateEntity(sync, entity, sourceId) {
|
||||
else {
|
||||
throw new Error(`Unrecognized entity type ${entityName}`);
|
||||
}
|
||||
|
||||
// currently making exception for protected notes and note revisions because here
|
||||
// the title and content are not available decrypted as listeners would expect
|
||||
if ((entityName !== 'notes' && entityName !== 'note_revisions') || !entity.isProtected) {
|
||||
await eventService.emit(eventService.ENTITY_SYNCED, {
|
||||
entityName,
|
||||
entity
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deserializeNoteContentBuffer(note) {
|
||||
|
||||
Reference in New Issue
Block a user