mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Debounce Character and Persona search
This commit is contained in:
parent
d7ade487b8
commit
61e2877c4b
@ -8668,14 +8668,20 @@ jQuery(async function () {
|
|||||||
|
|
||||||
$(document).on('click', '.swipe_left', swipe_left);
|
$(document).on('click', '.swipe_left', swipe_left);
|
||||||
|
|
||||||
|
const debouncedCharacterSearch = debounce((searchQuery) => {
|
||||||
|
entitiesFilter.setFilterData(FILTER_TYPES.SEARCH, searchQuery);
|
||||||
|
});
|
||||||
$('#character_search_bar').on('input', function () {
|
$('#character_search_bar').on('input', function () {
|
||||||
const searchValue = String($(this).val()).toLowerCase();
|
const searchQuery = String($(this).val()).toLowerCase();
|
||||||
entitiesFilter.setFilterData(FILTER_TYPES.SEARCH, searchValue);
|
debouncedCharacterSearch(searchQuery);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const debouncedPersonaSearch = debounce((searchQuery) => {
|
||||||
|
personasFilter.setFilterData(FILTER_TYPES.PERSONA_SEARCH, searchQuery);
|
||||||
|
});
|
||||||
$('#persona_search_bar').on('input', function () {
|
$('#persona_search_bar').on('input', function () {
|
||||||
const searchValue = String($(this).val()).toLowerCase();
|
const searchQuery = String($(this).val()).toLowerCase();
|
||||||
personasFilter.setFilterData(FILTER_TYPES.PERSONA_SEARCH, searchValue);
|
debouncedPersonaSearch(searchQuery);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mes_continue').on('click', function () {
|
$('#mes_continue').on('click', function () {
|
||||||
|
@ -3038,12 +3038,12 @@ jQuery(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const debouncedWISearch = debounce((searchQuery) => {
|
const debouncedWorldInfoSearch = debounce((searchQuery) => {
|
||||||
worldInfoFilter.setFilterData(FILTER_TYPES.WORLD_INFO_SEARCH, searchQuery);
|
worldInfoFilter.setFilterData(FILTER_TYPES.WORLD_INFO_SEARCH, searchQuery);
|
||||||
});
|
});
|
||||||
$('#world_info_search').on('input', function () {
|
$('#world_info_search').on('input', function () {
|
||||||
const searchQuery = $(this).val();
|
const searchQuery = $(this).val();
|
||||||
debouncedWISearch(searchQuery);
|
debouncedWorldInfoSearch(searchQuery);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#world_refresh').on('click', () => {
|
$('#world_refresh').on('click', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user