Wait for chat save before close or create new chat

This commit is contained in:
Cohee
2025-05-17 09:17:32 +03:00
parent e52b3afea9
commit b571723f94

View File

@@ -9909,6 +9909,7 @@ export async function doNewChat({ deleteCurrentChat = false } = {}) {
}
//Fix it; New chat doesn't create while open create character menu
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
await clearChat();
chat.length = 0;
@@ -11205,6 +11206,7 @@ jQuery(async function () {
else if (id == 'option_close_chat') {
if (is_send_press == false) {
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
await clearChat();
chat.length = 0;
resetSelectedGroup();
@@ -11219,7 +11221,7 @@ jQuery(async function () {
select_rm_characters();
await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
} else {
toastr.info('Please stop the message generation first.');
toastr.info(t`Please stop the message generation first.`);
}
}