Added event emmiters when creating new chats

This commit is contained in:
splitclover 2024-06-21 13:12:57 +02:00 committed by GitHub
parent e9f93ba748
commit 2a1704add0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -431,7 +431,9 @@ export const event_types = {
CHARACTER_MESSAGE_RENDERED: 'character_message_rendered', CHARACTER_MESSAGE_RENDERED: 'character_message_rendered',
FORCE_SET_BACKGROUND: 'force_set_background', FORCE_SET_BACKGROUND: 'force_set_background',
CHAT_DELETED: 'chat_deleted', CHAT_DELETED: 'chat_deleted',
CHAT_CREATED: 'chat_created',
GROUP_CHAT_DELETED: 'group_chat_deleted', GROUP_CHAT_DELETED: 'group_chat_deleted',
GROUP_CHAT_CREATED: 'group_chat_created',
GENERATE_BEFORE_COMBINE_PROMPTS: 'generate_before_combine_prompts', GENERATE_BEFORE_COMBINE_PROMPTS: 'generate_before_combine_prompts',
GENERATE_AFTER_COMBINE_PROMPTS: 'generate_after_combine_prompts', GENERATE_AFTER_COMBINE_PROMPTS: 'generate_after_combine_prompts',
GROUP_MEMBER_DRAFTED: 'group_member_drafted', GROUP_MEMBER_DRAFTED: 'group_member_drafted',
@ -9214,6 +9216,7 @@ 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_DELETED);
} }
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;
@ -9223,6 +9226,7 @@ jQuery(async function () {
await getChat(); await getChat();
await createOrEditCharacter(new CustomEvent('newChat')); await createOrEditCharacter(new CustomEvent('newChat'));
if (isDelChatCheckbox) await delChat(chat_file_for_del + '.jsonl'); if (isDelChatCheckbox) await delChat(chat_file_for_del + '.jsonl');
await eventSource.emit(event_types.CHAT_CREATED);
} }
} }