fix Branch reference to parent note id after parent change

This commit is contained in:
azivner 2019-01-05 19:25:22 +01:00
parent db44c1d8e6
commit 373408e401
2 changed files with 6 additions and 2 deletions

View file

@ -158,7 +158,11 @@ class TreeCache {
return;
}
treeCache.childParentToBranch[childNoteId + '-' + newParentNoteId] = treeCache.childParentToBranch[childNoteId + '-' + oldParentNoteId];
const branchId = treeCache.childParentToBranch[childNoteId + '-' + oldParentNoteId];
const branch = await this.getBranch(branchId);
branch.parentNoteId = newParentNoteId;
treeCache.childParentToBranch[childNoteId + '-' + newParentNoteId] = branchId;
delete treeCache.childParentToBranch[childNoteId + '-' + oldParentNoteId]; // this is correct because we know that oldParentId isn't same as newParentId
// remove old associations

View file

@ -60,7 +60,7 @@
display: flex;
justify-content: space-around;
padding: 10px 0 10px 0;
margin: 0 10px 0 10px;
margin: 0 20px 0 10px;
border: 1px solid #ddd;
border-radius: 5px;
}