mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
autocomplete doesn't show clones and encrypted items (when encryption not available)
This commit is contained in:
parent
9e5fcb8be2
commit
66f4176fe8
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user