Fix emmiter for imported cards

This commit is contained in:
splitclover 2024-06-21 13:53:31 +02:00 committed by GitHub
parent 3092c68a05
commit feb8321147
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -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);