Fix reasoning not always being synced to swipe

This commit is contained in:
Wolfsblvt 2025-02-25 17:10:13 +01:00
parent 4ab54016ad
commit 8bdc00e0b9

View File

@ -1,7 +1,7 @@
import {
moment,
} from '../lib.js';
import { chat, closeMessageEditor, event_types, eventSource, main_api, messageFormatting, saveChatConditional, saveChatDebounced, saveSettingsDebounced, substituteParams, updateMessageBlock } from '../script.js';
import { chat, closeMessageEditor, event_types, eventSource, main_api, messageFormatting, saveChatConditional, saveChatDebounced, saveSettingsDebounced, substituteParams, syncMesToSwipe, updateMessageBlock } from '../script.js';
import { getRegexedString, regex_placement } from './extensions/regex/engine.js';
import { getCurrentLocale, t, translate } from './i18n.js';
import { MacrosParser } from './macros.js';
@ -1046,8 +1046,10 @@ function registerReasoningAppEvents() {
message.mes = parsedReasoning.content;
}
// Find if a message already exists in DOM and must be updated
if (contentUpdated) {
syncMesToSwipe();
// Find if a message already exists in DOM and must be updated
const messageRendered = document.querySelector(`.mes[mesid="${idx}"]`) !== null;
if (messageRendered) {
console.debug('[Reasoning] Updating message block', idx);