mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
use notePath instead of noteId for note creation to correctly work with cloned ancestors
This commit is contained in:
@@ -491,7 +491,7 @@ export default class AttributeEditorWidget extends TabAwareWidget {
|
||||
}
|
||||
|
||||
async createNoteForReferenceLink(title) {
|
||||
const {note} = await noteCreateService.createNote(this.noteId, {
|
||||
const {note} = await noteCreateService.createNote(this.notePath, {
|
||||
activate: false,
|
||||
title: title
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ class MobileDetailMenuWidget extends BasicWidget {
|
||||
],
|
||||
selectMenuItemHandler: async ({command}) => {
|
||||
if (command === "insertChildNote") {
|
||||
noteCreateService.createNote(note.noteId);
|
||||
noteCreateService.createNote(appContext.tabManager.getActiveTabNotePath());
|
||||
}
|
||||
else if (command === "delete") {
|
||||
const notePath = appContext.tabManager.getActiveTabNotePath();
|
||||
|
||||
@@ -318,7 +318,7 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
||||
}
|
||||
|
||||
// without await as this otherwise causes deadlock through component mutex
|
||||
noteCreateService.createNote(note.noteId, {
|
||||
noteCreateService.createNote(appContext.tabManager.getActiveTabNotePath(), {
|
||||
isProtected: note.isProtected,
|
||||
saveSelection: true
|
||||
});
|
||||
|
||||
@@ -203,8 +203,9 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
this.$tree.on("mousedown", ".refresh-search-button", e => this.refreshSearch(e));
|
||||
this.$tree.on("mousedown", ".add-note-button", e => {
|
||||
const node = $.ui.fancytree.getNode(e);
|
||||
const parentNotePath = treeService.getNotePath(node);
|
||||
|
||||
noteCreateService.createNote(node.data.noteId, {
|
||||
noteCreateService.createNote(parentNotePath, {
|
||||
isProtected: node.data.isProtected
|
||||
});
|
||||
});
|
||||
|
||||
@@ -274,7 +274,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
}
|
||||
|
||||
async createNoteForReferenceLink(title) {
|
||||
const {note} = await noteCreateService.createNote(this.noteId, {
|
||||
const {note} = await noteCreateService.createNote(this.notePath, {
|
||||
activate: false,
|
||||
title: title
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user