perf: lazy load tag list for awesome bar
In last 7 days not a single person has used this feature on FC (based on endpoint logs). fix: When user knowingly triggers by typing text starting with `#` we fire request to get tags lazily.
This commit is contained in:
parent
b919618032
commit
54b36e8604
2 changed files with 5 additions and 1 deletions
|
|
@ -127,7 +127,6 @@ frappe.search.AwesomeBar = class AwesomeBar {
|
|||
}
|
||||
});
|
||||
frappe.search.utils.setup_recent();
|
||||
frappe.tags.utils.fetch_tags();
|
||||
}
|
||||
|
||||
add_help() {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@ frappe.tags.utils = {
|
|||
txt = txt.slice(1);
|
||||
let out = [];
|
||||
|
||||
if (!frappe.tags.tags) {
|
||||
frappe.tags.utils.fetch_tags();
|
||||
return [];
|
||||
}
|
||||
|
||||
for (let i in frappe.tags.tags) {
|
||||
let tag = frappe.tags.tags[i];
|
||||
let level = frappe.search.utils.fuzzy_search(txt, tag);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue