Apply fix for group chats

This commit is contained in:
Cohee 2024-06-21 12:59:18 +00:00
parent 7667231137
commit 56710fee39
2 changed files with 3 additions and 1 deletions

View File

@ -9219,7 +9219,6 @@ jQuery(async function () {
if (selected_group) { if (selected_group) {
await createNewGroupChat(selected_group); await createNewGroupChat(selected_group);
if (isDelChatCheckbox) await deleteGroupChat(selected_group, chat_file_for_del); if (isDelChatCheckbox) await deleteGroupChat(selected_group, chat_file_for_del);
await eventSource.emit(event_types.GROUP_CHAT_CREATED);
} }
else { else {
//RossAscends: added character name to new chat filenames and replaced Date.now() with humanizedDateTime; //RossAscends: added character name to new chat filenames and replaced Date.now() with humanizedDateTime;

View File

@ -183,6 +183,7 @@ export async function getGroupChat(groupId, reload = false) {
const group = groups.find((x) => x.id === groupId); const group = groups.find((x) => x.id === groupId);
const chat_id = group.chat_id; const chat_id = group.chat_id;
const data = await loadGroupChat(chat_id); const data = await loadGroupChat(chat_id);
let freshChat = false;
await loadItemizedPrompts(getCurrentChatId()); await loadItemizedPrompts(getCurrentChatId());
@ -216,6 +217,7 @@ export async function getGroupChat(groupId, reload = false) {
} }
} }
await saveGroupChat(groupId, false); await saveGroupChat(groupId, false);
freshChat = true;
} }
if (group) { if (group) {
@ -228,6 +230,7 @@ export async function getGroupChat(groupId, reload = false) {
} }
await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
if (freshChat) await eventSource.emit(event_types.GROUP_CHAT_CREATED);
} }
/** /**