autocomplete doesn't show clones and encrypted items (when encryption not available)

This commit is contained in:
azivner 2017-09-18 20:48:02 -04:00
parent 9e5fcb8be2
commit 66f4176fe8
2 changed files with 13 additions and 6 deletions

View file

@ -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) {

View file

@ -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;