mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-01-26 19:19:57 +00:00
Safety checks for translations
Should prevent list getting cut off if no translation or alias matches
This commit is contained in:
@@ -384,8 +384,12 @@ function addResultsToList(textArea, results, tagword, resetList) {
|
||||
// search in translations if no alias matches
|
||||
if (!bestAlias) {
|
||||
let tagOrAlias = pair => pair[0] === result[0] || result[3].split(",").includes(pair[0]);
|
||||
var translationKey = [...translations].find(pair => tagOrAlias(pair) && pair[1].includes(tagword))[0];
|
||||
bestAlias = translationKey// ? translations.get(translationKey) : null;
|
||||
var tArray = [...translations];
|
||||
if (tArray) {
|
||||
var translationKey = [...translations].find(pair => tagOrAlias(pair) && pair[1].includes(tagword));
|
||||
if (translationKey)
|
||||
bestAlias = translationKey[0];
|
||||
}
|
||||
}
|
||||
|
||||
displayText = escapeHTML(bestAlias);
|
||||
|
||||
Reference in New Issue
Block a user