Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
after note creation with becca
zadama5ee5905441f
diff --git a/src/services/notes.js b/src/services/notes.jsindex 33a3ff3ce5..fe99d2c178 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -145,7 +145,7 @@ function createNewNote(params) {function createNewNoteWithTarget(target, targetBranchId, params) {if (!params.type) {- const parentNote = repository.getNote(params.parentNoteId);+ const parentNote = becca.notes[params.parentNoteId];// code note type can be inherited, otherwise text is defaultparams.type = parentNote.type === 'code' ? 'code' : 'text';@@ -156,13 +156,13 @@ function createNewNoteWithTarget(target, targetBranchId, params) {return createNewNote(params);}else if (target === 'after') {- const afterNote = becca.branches[targetBranchId].notePosition;+ const afterBranch = becca.branches[targetBranchId];- // not updating utcDateModified to avoig having to sync whole rows+ // not updating utcDateModified to avoid having to sync whole rowssql.execute('UPDATE branches SET notePosition = notePosition + 10 WHERE parentNoteId = ? AND notePosition > ? AND isDeleted = 0',- [params.parentNoteId, afterNote.notePosition]);+ [params.parentNoteId, afterBranch.notePosition]);- params.notePosition = afterNote.notePosition + 10;+ params.notePosition = afterBranch.notePosition + 10;const retObject = createNewNote(params);