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
autocomplete doesn't show clones and encrypted items (when encryption not available)
azivner66f4176fe8d4
diff --git a/static/js/tree_utils.js b/static/js/tree_utils.jsindex 6e5d52d230..c9e444f43d 100644--- a/static/js/tree_utils.js+++ b/static/js/tree_utils.js@@ -12,6 +12,11 @@ function getNodeByKey(noteId) {function getFullName(noteId) {let note = getNodeByKey(noteId);++ if (note.data.is_clone || (note.data.encryption > 0 && !isEncryptionAvailable())) {+ return null;+ }+const path = [];while (note) {diff --git a/static/js/utils.js b/static/js/utils.jsindex 9e9c822d48..3ae17c03e2 100644--- a/static/js/utils.js+++ b/static/js/utils.js@@ -14,16 +14,18 @@ function error(str) {error.fadeOut(10000);}-function getAutocompleteItems(notes) {+function getAutocompleteItems(noteIds) {const autocompleteItems = [];- for (const noteId of notes) {+ for (const noteId of noteIds) {const fullName = getFullName(noteId);- autocompleteItems.push({- value: fullName + " (" + noteId + ")",- label: fullName- });+ if (fullName !== null) {+ autocompleteItems.push({+ value: fullName + " (" + noteId + ")",+ label: fullName+ });+ }}return autocompleteItems;