Wait for chat save before close or create new chat
| @@ -9909,6 +9909,7 @@ export async function doNewChat({ deleteCurrentChat = false } = {}) { | ||
| 9909 | 9909 | } |
| 9910 | 9910 | |
| 9911 | 9911 | //Fix it; New chat doesn't create while open create character menu |
| 9912 | + await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10); | |
| 9912 | 9913 | await clearChat(); |
| 9913 | 9914 | chat.length = 0; |
| 9914 | 9915 | |
| @@ -11205,6 +11206,7 @@ jQuery(async function () { | ||
| 11205 | 11206 | |
| 11206 | 11207 | else if (id == 'option_close_chat') { |
| 11207 | 11208 | if (is_send_press == false) { |
| 11209 | + await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10); | |
| 11208 | 11210 | await clearChat(); |
| 11209 | 11211 | chat.length = 0; |
| 11210 | 11212 | resetSelectedGroup(); |
| @@ -11219,7 +11221,7 @@ jQuery(async function () { | ||
| 11219 | 11221 | select_rm_characters(); |
| 11220 | 11222 | await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); |
| 11221 | 11223 | } else { |
| 11222 | 11224 | toastr.info('t`Please stop the message generation first.'`); |
| 11223 | 11225 | } |
| 11224 | 11226 | } |
| 11225 | 11227 | |