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) {
|
function getFullName(noteId) {
|
||||||
let note = getNodeByKey(noteId);
|
let note = getNodeByKey(noteId);
|
||||||
|
|
||||||
|
if (note.data.is_clone || (note.data.encryption > 0 && !isEncryptionAvailable())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const path = [];
|
const path = [];
|
||||||
|
|
||||||
while (note) {
|
while (note) {
|
||||||
|
@ -14,17 +14,19 @@ function error(str) {
|
|||||||
error.fadeOut(10000);
|
error.fadeOut(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAutocompleteItems(notes) {
|
function getAutocompleteItems(noteIds) {
|
||||||
const autocompleteItems = [];
|
const autocompleteItems = [];
|
||||||
|
|
||||||
for (const noteId of notes) {
|
for (const noteId of noteIds) {
|
||||||
const fullName = getFullName(noteId);
|
const fullName = getFullName(noteId);
|
||||||
|
|
||||||
|
if (fullName !== null) {
|
||||||
autocompleteItems.push({
|
autocompleteItems.push({
|
||||||
value: fullName + " (" + noteId + ")",
|
value: fullName + " (" + noteId + ")",
|
||||||
label: fullName
|
label: fullName
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return autocompleteItems;
|
return autocompleteItems;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user