waitForFrame in scrollChatToBottom in sync scenarios #4791

24676882084c13b081f452d992f4ba6888a262ab

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -2Showing whitespace changes
public/script.js+2 -2
@@ -1416,7 +1416,7 @@ export async function printMessages() {
1416 chatElement.find('.mes').last().addClass('last_mes');1416 chatElement.find('.mes').last().addClass('last_mes');
1417 refreshSwipeButtons();1417 refreshSwipeButtons();
1418 applyStylePins();1418 applyStylePins();
1419 scrollChatToBottom();1419 scrollChatToBottom({ waitForFrame: true });
1420 delay(debounce_timeout.short).then(() => scrollOnMediaLoad());1420 delay(debounce_timeout.short).then(() => scrollOnMediaLoad());
1421}1421}
14221422
@@ -2532,7 +2532,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll
25322532
2533 // Don't scroll if not inserting last2533 // Don't scroll if not inserting last
2534 if (!insertAfter && !insertBefore && scroll) {2534 if (!insertAfter && !insertBefore && scroll) {
2535 scrollChatToBottom();2535 scrollChatToBottom({ waitForFrame: true });
2536 }2536 }
25372537
2538 applyCharacterTagsToMessageDivs({ mesIds: newMessageId });2538 applyCharacterTagsToMessageDivs({ mesIds: newMessageId });