refactored note creation methods into a separate service

This commit is contained in:
zadam
2020-02-03 20:07:34 +01:00
parent 822a8509b3
commit 66204811cf
9 changed files with 138 additions and 110 deletions

View File

@@ -485,11 +485,12 @@ eventService.subscribe([eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED
delete childParentToBranchId[branch.noteId + '-' + branch.parentNoteId];
}
else {
// ... and then we create new records
if (branch.prefix) {
prefixes[branch.noteId + '-' + branch.parentNoteId] = branch.prefix;
}
childToParent[branch.noteId] = childToParent[branch.noteId] || [];
if (!childToParent[branch.noteId].includes(branch.parentNoteId)) {
childToParent[branch.noteId].push(branch.parentNoteId);
}