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
fix setNoteToParent API method, closes #360
azivner596544eca335
diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.jsindex b58b948358..2f0337e0af 100644--- a/src/public/javascripts/services/attributes.js+++ b/src/public/javascripts/services/attributes.js@@ -160,7 +160,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {$input.autocomplete({appendTo: document.querySelector('body'),hint: false,- autoselect: true,+ autoselect: false,openOnFocus: true,minLength: 0,tabAutocomplete: falsediff --git a/src/services/tree.js b/src/services/tree.jsindex 6e97ed065a..9d2a414889 100644--- a/src/services/tree.js+++ b/src/services/tree.js@@ -113,8 +113,8 @@ async function sortNotesAlphabetically(parentNoteId) {async function setNoteToParent(noteId, prefix, parentNoteId) {const parentNote = await repository.getNote(parentNoteId);- if (parentNote.isDeleted) {- throw new Error("Cannot move note to deleted parent note");+ if (parentNote && parentNote.isDeleted) {+ throw new Error(`Cannot move note to deleted parent note ${parentNoteId}`);}// case where there might be more such branches is ignored. It's expected there should be just one