From 495feb026c83978c12d81d25635c39719cbc9b8b Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Thu, 11 May 2023 17:30:47 +0200 Subject: [PATCH] Fix formatting --- javascript/tagAutocomplete.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 84f04e4..a9f05ff 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -146,7 +146,7 @@ async function syncOptions() { useHypernetworks: opts["tac_useHypernetworks"], useLoras: opts["tac_useLoras"], useChants: opts["tac_useChants"], - useLycos: opts["tac_useLycos"], + useLycos: opts["tac_useLycos"], showWikiLinks: opts["tac_showWikiLinks"], // Insertion related settings replaceUnderscores: opts["tac_replaceUnderscores"], @@ -175,6 +175,7 @@ async function syncOptions() { keymap: JSON.parse(opts["tac_keymap"]), colorMap: JSON.parse(opts["tac_colormap"]) } + if (newCFG.alias.onlyShowAlias) { newCFG.alias.searchByAlias = true; // if only show translation, enable search by translation is necessary } @@ -403,11 +404,10 @@ function addResultsToList(textArea, results, tagword, resetList) { itemText.classList.add("acListItem"); let displayText = ""; + // If the tag matches the tagword, we don't need to display the alias if(result.type === ResultType.chant) { displayText = escapeHTML(result.aliases); - } - // If the tag matches the tagword, we don't need to display the alias - else if (result.aliases && !result.text.includes(tagword)) { // Alias + } else if (result.aliases && !result.text.includes(tagword)) { // Alias let splitAliases = result.aliases.split(","); let bestAlias = splitAliases.find(a => a.toLowerCase().includes(tagword));