Skip to content

Build your personal knowledge base with Trilium Notes

fix createNoteInto keyboard shortcut

zadamd4d54c5f0117
diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js
index 55270ca522..082e1c1e0d 100644
--- a/src/public/javascripts/services/entrypoints.js
+++ b/src/public/javascripts/services/entrypoints.js
@@ -177,4 +177,15 @@ export default class Entrypoints extends Component {
this.triggerCommand('moveBranchIdsTo', {branchIds: selectedOrActiveBranchIds});
}
+
+ async createNoteIntoCommand() {
+ const note = appContext.tabManager.getActiveTabNote();
+
+ if (note) {
+ await noteCreateService.createNote(note.noteId, {
+ isProtected: note.isProtected,
+ saveSelection: false
+ });
+ }
+ }
}
diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.js
index ba04363bef..5b70b4e451 100644
--- a/src/public/javascripts/widgets/note_tree.js
+++ b/src/public/javascripts/widgets/note_tree.js
@@ -575,17 +575,6 @@ export default class NoteTreeWidget extends TabAwareWidget {
});
}
- async createNoteIntoCommand() {
- const node = this.getActiveNode();
-
- if (node) {
- await noteCreateService.createNote(node.data.noteId, {
- isProtected: node.data.isProtected,
- saveSelection: false
- });
- }
- }
-
async setExpandedToServer(branchId, isExpanded) {
utils.assertArguments(branchId);