Fix hide after insert race condition

This commit is contained in:
DominikDoom
2023-10-01 23:17:12 +02:00
parent 04551a8132
commit 363895494b
2 changed files with 4 additions and 3 deletions

View File

@@ -191,8 +191,8 @@ function mapUseCountArray(useCounts) {
return useCounts.map(useCount => {return {"name": useCount[0], "type": useCount[1], "count": useCount[2]}});
}
// Call API endpoint to increase bias of tag in the database
async function increaseUseCount(tagName, type) {
await postAPI(`tacapi/v1/increase-use-count?tagname=${tagName}&ttype=${type}`);
function increaseUseCount(tagName, type) {
postAPI(`tacapi/v1/increase-use-count?tagname=${tagName}&ttype=${type}`);
}
// Get use count of tag from the database
async function getUseCount(tagName, type) {

View File

@@ -588,7 +588,8 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout
// Since we've modified a Gradio Textbox component manually, we need to simulate an `input` DOM event to ensure it's propagated back to python.
// Uses a built-in method from the webui's ui.js which also already accounts for event target
tacSelfTrigger = true;
if (tagType === ResultType.wildcardTag || tagType === ResultType.wildcardFile || tagType === ResultType.yamlWildcard)
tacSelfTrigger = true;
updateInput(textArea);
// Update previous tags with the edited prompt to prevent re-searching the same term