This commit is contained in:
zadam
2020-02-09 22:31:52 +01:00
parent 99ea238c3f
commit 7767edd82f
7 changed files with 25 additions and 24 deletions

View File

@@ -218,6 +218,9 @@ async function processSyncRows(syncRows) {
const parentNote = treeCache.notes[sync.entity.parentNoteId];
if (branch) {
branch.update(sync.entity);
loadResults.addBranch(sync.entityId, sync.sourceId);
if (sync.entity.isDeleted) {
if (childNote) {
childNote.parents = childNote.parents.filter(parentNoteId => parentNoteId !== sync.entity.parentNoteId);
@@ -230,9 +233,6 @@ async function processSyncRows(syncRows) {
}
}
else {
branch.update(sync.entity);
loadResults.addBranch(sync.entityId, sync.sourceId);
if (childNote) {
childNote.addParent(branch.parentNoteId, branch.branchId);
}