mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
prefix match for autocomplete attribute search
This commit is contained in:
@@ -27,6 +27,20 @@ class NoteCache {
|
||||
return this.attributeIndex[`${type}-${name}`] || [];
|
||||
}
|
||||
|
||||
/** @return {Attribute[]} */
|
||||
findAttributesWithPrefix(type, name) {
|
||||
const resArr = [];
|
||||
const key = `${type}-${name}`;
|
||||
|
||||
for (const idx in this.attributeIndex) {
|
||||
if (idx.startsWith(key)) {
|
||||
resArr.push(this.attributeIndex[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
return resArr.flat();
|
||||
}
|
||||
|
||||
decryptProtectedNotes() {
|
||||
for (const note of Object.values(this.notes)) {
|
||||
note.decrypt();
|
||||
|
||||
Reference in New Issue
Block a user