mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
making showMoreMessages async to await event emission
This commit is contained in:
@ -1830,7 +1830,7 @@ export async function replaceCurrentChat() {
|
||||
}
|
||||
}
|
||||
|
||||
export function showMoreMessages(messagesToLoad = null) {
|
||||
export async function showMoreMessages(messagesToLoad = null) {
|
||||
const firstDisplayedMesId = $('#chat').children('.mes').first().attr('mesid');
|
||||
let messageId = Number(firstDisplayedMesId);
|
||||
let count = messagesToLoad || power_user.chat_truncation || Number.MAX_SAFE_INTEGER;
|
||||
@ -1861,7 +1861,7 @@ export function showMoreMessages(messagesToLoad = null) {
|
||||
$('#chat').scrollTop(newHeight - prevHeight);
|
||||
}
|
||||
|
||||
eventSource.emit(event_types.MORE_MESSAGES_LOADED)
|
||||
await eventSource.emit(event_types.MORE_MESSAGES_LOADED)
|
||||
}
|
||||
|
||||
export async function printMessages() {
|
||||
@ -11468,8 +11468,8 @@ jQuery(async function () {
|
||||
$('#avatar-and-name-block').slideToggle();
|
||||
});
|
||||
|
||||
$(document).on('mouseup touchend', '#show_more_messages', () => {
|
||||
showMoreMessages();
|
||||
$(document).on('mouseup touchend', '#show_more_messages', async function () {
|
||||
await showMoreMessages();
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_characters_library', async function () {
|
||||
|
Reference in New Issue
Block a user