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
|
//Fix it; New chat doesn't create while open create character menu
|
||||||
|
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
|
||||||
await clearChat();
|
await clearChat();
|
||||||
chat.length = 0;
|
chat.length = 0;
|
||||||
|
|
||||||
@@ -11205,6 +11206,7 @@ jQuery(async function () {
|
|||||||
|
|
||||||
else if (id == 'option_close_chat') {
|
else if (id == 'option_close_chat') {
|
||||||
if (is_send_press == false) {
|
if (is_send_press == false) {
|
||||||
|
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
|
||||||
await clearChat();
|
await clearChat();
|
||||||
chat.length = 0;
|
chat.length = 0;
|
||||||
resetSelectedGroup();
|
resetSelectedGroup();
|
||||||
@@ -11219,7 +11221,7 @@ jQuery(async function () {
|
|||||||
select_rm_characters();
|
select_rm_characters();
|
||||||
await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
|
await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
|
||||||
} else {
|
} 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