diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 1b1209a..45c4021 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -835,8 +835,10 @@ async function autocomplete(textArea, prompt, fixedTag = null) { versionString = searchTerm.slice(0, 2); searchTerm = searchTerm.slice(2); } - let versionCondition = x => x[1] && x[1] === versionString; - tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm) && versionCondition(x)); // Filter by tagword + if (versionString) + tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm) && x[1] && x[1] === versionString); // Filter by tagword + else + tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm)); // Filter by tagword } else { tempResults = embeddings; }