mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 15:55:52 +01:00
load ancestors and templates when receiving sync from backend
This commit is contained in:
@@ -203,6 +203,25 @@ subscribeToMessages(message => {
|
||||
});
|
||||
|
||||
async function processSyncRows(syncRows) {
|
||||
const missingNoteIds = [];
|
||||
|
||||
syncRows.forEach(({entityName, entity}) => {
|
||||
if (entityName === 'branches' && !(entity.parentNoteId in treeCache.notes)) {
|
||||
missingNoteIds.push(entity.parentNoteId);
|
||||
}
|
||||
else if (entityName === 'attributes'
|
||||
&& entity.type === 'relation'
|
||||
&& entity.name === 'template'
|
||||
&& !(entity.noteId in treeCache.notes)) {
|
||||
|
||||
missingNoteIds.push(entity.value);
|
||||
}
|
||||
});
|
||||
|
||||
if (missingNoteIds.length > 0) {
|
||||
await treeCache.reloadNotes(missingNoteIds);
|
||||
}
|
||||
|
||||
const loadResults = new LoadResults(treeCache);
|
||||
|
||||
syncRows.filter(sync => sync.entityName === 'notes').forEach(sync => {
|
||||
|
||||
Reference in New Issue
Block a user