diff --git a/static/js/tree_utils.js b/static/js/tree_utils.js index 6e5d52d23..c9e444f43 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.js index 9e9c822d4..3ae17c03e 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;