tree change listener and others

This commit is contained in:
zadam
2020-01-29 21:38:58 +01:00
parent 439b45b0b8
commit b65631be7e
10 changed files with 140 additions and 49 deletions

View File

@@ -230,10 +230,11 @@ class TreeCache {
return child.parentToBranch[parentNoteId];
}
// FIXME does not actually belong here
async processSyncRows(syncRows) {
const noteIdsToReload = [];
const loadResults = new LoadResults();
const loadResults = new LoadResults(this);
syncRows.filter(sync => sync.entityName === 'branches').forEach(sync => {
noteIdsToReload.push(sync.parentNoteId);
@@ -261,6 +262,11 @@ class TreeCache {
loadResults.addAttribute(sync.entityId, sync.sourceId);
});
// missing reloading the relation target note
syncRows.filter(sync => sync.entityName === 'note_revisions').forEach(sync => {
loadResults.addNoteRevision(sync.entityId, sync.noteId, sync.sourceId);
});
await this.reloadNotes(noteIdsToReload);
const appContext = (await import('./app_context.js')).default;