Fix emmiter for imported cards
This commit is contained in:
parent
3092c68a05
commit
feb8321147
|
@ -5886,11 +5886,13 @@ export async function getChat() {
|
||||||
|
|
||||||
async function getChatResult() {
|
async function getChatResult() {
|
||||||
name2 = characters[this_chid].name;
|
name2 = characters[this_chid].name;
|
||||||
|
let freshChat = false;
|
||||||
if (chat.length === 0) {
|
if (chat.length === 0) {
|
||||||
const message = getFirstMessage();
|
const message = getFirstMessage();
|
||||||
if (message.mes) {
|
if (message.mes) {
|
||||||
chat.push(message);
|
chat.push(message);
|
||||||
await saveChatConditional();
|
await saveChatConditional();
|
||||||
|
freshChat = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await loadItemizedPrompts(getCurrentChatId());
|
await loadItemizedPrompts(getCurrentChatId());
|
||||||
|
@ -5898,6 +5900,7 @@ async function getChatResult() {
|
||||||
select_selected_character(this_chid);
|
select_selected_character(this_chid);
|
||||||
|
|
||||||
await eventSource.emit(event_types.CHAT_CHANGED, (getCurrentChatId()));
|
await eventSource.emit(event_types.CHAT_CHANGED, (getCurrentChatId()));
|
||||||
|
if (freshChat) await eventSource.emit(event_types.CHAT_CREATED);
|
||||||
|
|
||||||
if (chat.length === 1) {
|
if (chat.length === 1) {
|
||||||
const chat_id = (chat.length - 1);
|
const chat_id = (chat.length - 1);
|
||||||
|
|
Loading…
Reference in New Issue