Rename queues to fit const naming convention

This commit is contained in:
Dominik Reh
2023-01-29 16:40:04 +01:00
parent 8e14221739
commit 29d1e7212d
3 changed files with 8 additions and 8 deletions

View File

@@ -39,9 +39,9 @@ var umiPreviousTags = [];
/// Similar to a callback system, but primitive.
// Queues
const afterInsertQueue = [];
const afterSetupQueue = [];
const afterConfigChangeQueue = [];
const QUEUE_AFTER_INSERT = [];
const QUEUE_AFTER_SETUP = [];
const QUEUE_AFTER_CONFIG_CHANGE = [];
// List of parsers to try
const parsers = [];
const PARSERS = [];

View File

@@ -113,7 +113,7 @@ async function processQueueReturn(queue, context, ...args)
// Specific to tag completion parsers
async function processParsers(textArea, prompt) {
// Get all parsers that have a successful trigger condition
let matchingParsers = parsers.filter(parser => parser.triggerCondition());
let matchingParsers = PARSERS.filter(parser => parser.triggerCondition());
// Guard condition
if (matchingParsers.length === 0) {
return null;

View File

@@ -226,7 +226,7 @@ async function syncOptions() {
CFG = newCFG;
// Callback
processQueue(afterConfigChangeQueue, null);
processQueue(QUEUE_AFTER_CONFIG_CHANGE, null);
}
// Create the result list div and necessary styling
@@ -362,7 +362,7 @@ function insertTextAtCursor(textArea, result, tagword) {
previousTags = tags;
// Callback
processQueue(afterInsertQueue, null, tagType);
processQueue(QUEUE_AFTER_INSERT, null, tagType);
// If it was a yaml wildcard, also update the umiPreviousTags
if (tagType === ResultType.yamlWildcard && originalTagword.length > 0) {
@@ -1266,7 +1266,7 @@ async function setup() {
gradioApp().appendChild(acStyle);
// Callback
processQueue(afterSetupQueue, null);
processQueue(QUEUE_AFTER_SETUP, null);
}
onUiUpdate(async () => {