use notePath instead of noteId for note creation to correctly work with cloned ancestors

This commit is contained in:
zadam
2021-03-03 22:48:06 +01:00
parent 8192b51b8a
commit 721e5da672
8 changed files with 25 additions and 21 deletions

View File

@@ -112,10 +112,10 @@ class TreeContextMenu {
appContext.tabManager.openTabWithNoteWithHoisting(notePath);
}
else if (command === "insertNoteAfter") {
const parentNoteId = this.node.data.parentNoteId;
const parentNotePath = treeService.getNotePath(this.node.getParent());
const isProtected = await treeService.getParentProtectedStatus(this.node);
noteCreateService.createNote(parentNoteId, {
noteCreateService.createNote(parentNotePath, {
target: 'after',
targetBranchId: this.node.data.branchId,
type: type,
@@ -123,14 +123,14 @@ class TreeContextMenu {
});
}
else if (command === "insertChildNote") {
noteCreateService.createNote(noteId, {
const parentNotePath = treeService.getNotePath(this.node);
noteCreateService.createNote(parentNotePath, {
type: type,
isProtected: this.node.data.isProtected
});
}
else {
console.log("Triggering", command, notePath);
this.treeWidget.triggerCommand(command, {node: this.node, notePath: notePath});
}
}