Switch back to regular debounce

This commit is contained in:
Cohee 2024-07-12 16:03:43 +00:00
parent 684ce999f3
commit 3acd60fcab
2 changed files with 3 additions and 4 deletions

View File

@ -156,7 +156,6 @@ import {
ensureImageFormatSupported,
flashHighlight,
isTrueBoolean,
debouncedThrottle,
} from './scripts/utils.js';
import { debounce_timeout } from './scripts/constants.js';
@ -9240,7 +9239,7 @@ jQuery(async function () {
e.style.height = `${newHeight}px`;
is_use_scroll_holder = true;
}
const autoFitEditTextAreaDebounced = debouncedThrottle(autoFitEditTextArea, debounce_timeout.short);
const autoFitEditTextAreaDebounced = debounce(autoFitEditTextArea, debounce_timeout.short);
document.addEventListener('input', e => {
if (e.target instanceof HTMLTextAreaElement && e.target.classList.contains('edit_textarea')) {
const immediately = e.target.scrollHeight > e.target.offsetHeight || e.target.value === '';

View File

@ -31,7 +31,7 @@ import {
SECRET_KEYS,
secret_state,
} from './secrets.js';
import { debounce, debouncedThrottle, getStringHash, isValidUrl } from './utils.js';
import { debounce, getStringHash, isValidUrl } from './utils.js';
import { chat_completion_sources, oai_settings } from './openai.js';
import { getTokenCountAsync } from './tokenizers.js';
import { textgen_types, textgenerationwebui_settings as textgen_settings, getTextGenServer } from './textgen-settings.js';
@ -707,7 +707,7 @@ function autoFitSendTextArea() {
chatBlock.scrollTop = newScrollTop;
}
}
export const autoFitSendTextAreaDebounced = debouncedThrottle(autoFitSendTextArea, debounce_timeout.short);
export const autoFitSendTextAreaDebounced = debounce(autoFitSendTextArea, debounce_timeout.short);
// ---------------------------------------------------