Prevent db response errors from breaking the regular completion

This commit is contained in:
DominikDoom
2024-04-14 12:01:15 +02:00
parent 700642a400
commit 9155e4d42c
2 changed files with 16 additions and 6 deletions

View File

@@ -1201,7 +1201,7 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
// Request use counts from the DB
const names = TAC_CFG.frequencyIncludeAlias ? tagNames.concat(aliasNames) : tagNames;
const counts = await getUseCounts(names, types, isNegative);
const counts = await getUseCounts(names, types, isNegative) || [];
// Pre-calculate weights to prevent duplicate work
const resultBiasMap = new Map();