Refactor common enum for debounce timeouts

This commit is contained in:
Wolfsblvt
2024-04-28 06:21:47 +02:00
parent 6d04e93f34
commit d7ade487b8
14 changed files with 51 additions and 33 deletions

View File

@ -2,7 +2,7 @@ import { callPopup, main_api } from '../../../script.js';
import { getContext } from '../../extensions.js';
import { registerSlashCommand } from '../../slash-commands.js';
import { getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, tokenizers } from '../../tokenizers.js';
import { resetScrollHeight, debounce } from '../../utils.js';
import { resetScrollHeight, debounce, debounce_timeout } from '../../utils.js';
function rgb2hex(rgb) {
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
@ -58,7 +58,7 @@ async function doTokenCounter() {
resetScrollHeight($('#token_counter_textarea'));
resetScrollHeight($('#token_counter_ids'));
}, 1000);
}, debounce_timeout.relaxed);
dialog.find('#token_counter_textarea').on('input', () => countDebounced());
$('#dialogue_popup').addClass('wide_dialogue_popup');