From feb8321147fae21640ba68ebe0fa2462894914f3 Mon Sep 17 00:00:00 2001 From: splitclover Date: Fri, 21 Jun 2024 13:53:31 +0200 Subject: [PATCH] Fix emmiter for imported cards --- public/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/script.js b/public/script.js index 7fab18d67..ed0e4d9b0 100644 --- a/public/script.js +++ b/public/script.js @@ -5886,11 +5886,13 @@ export async function getChat() { async function getChatResult() { name2 = characters[this_chid].name; + let freshChat = false; if (chat.length === 0) { const message = getFirstMessage(); if (message.mes) { chat.push(message); await saveChatConditional(); + freshChat = true; } } await loadItemizedPrompts(getCurrentChatId()); @@ -5898,6 +5900,7 @@ async function getChatResult() { select_selected_character(this_chid); await eventSource.emit(event_types.CHAT_CHANGED, (getCurrentChatId())); + if (freshChat) await eventSource.emit(event_types.CHAT_CREATED); if (chat.length === 1) { const chat_id = (chat.length - 1);