async for resetScrollHeight, slightly faster WI/AF panel loads

This commit is contained in:
RossAscends
2024-08-05 12:03:46 +09:00
parent c13ca77bd9
commit 64e716bb62
7 changed files with 42 additions and 38 deletions

View File

@@ -59,8 +59,8 @@ async function doTokenCounter() {
$('#tokenized_chunks_display').text('—');
}
resetScrollHeight($('#token_counter_textarea'));
resetScrollHeight($('#token_counter_ids'));
await resetScrollHeight($('#token_counter_textarea'));
await resetScrollHeight($('#token_counter_ids'));
}, debounce_timeout.relaxed);
dialog.find('#token_counter_textarea').on('input', () => countDebounced());
@@ -134,7 +134,8 @@ jQuery(() => {
</div>`;
$('#token_counter_wand_container').append(buttonHtml);
$('#token_counter').on('click', doTokenCounter);
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'count',
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'count',
callback: async () => String(await doCount()),
returns: 'number of tokens',
helpString: 'Counts the number of tokens in the current chat.',