mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Wait for chat save before close or create new chat
This commit is contained in:
@@ -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.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user