mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Wait for current chat to finish saving before allowing to switch
This commit is contained in:
@ -7299,6 +7299,7 @@ function getFirstMessage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function openCharacterChat(file_name) {
|
export async function openCharacterChat(file_name) {
|
||||||
|
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
|
||||||
await clearChat();
|
await clearChat();
|
||||||
characters[this_chid]['chat'] = file_name;
|
characters[this_chid]['chat'] = file_name;
|
||||||
chat.length = 0;
|
chat.length = 0;
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
localizePagination,
|
localizePagination,
|
||||||
renderPaginationDropdown,
|
renderPaginationDropdown,
|
||||||
paginationDropdownChangeHandler,
|
paginationDropdownChangeHandler,
|
||||||
|
waitUntilCondition,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
import { RA_CountCharTokens, humanizedDateTime, dragElement, favsToHotswap, getMessageTimeStamp } from './RossAscends-mods.js';
|
import { RA_CountCharTokens, humanizedDateTime, dragElement, favsToHotswap, getMessageTimeStamp } from './RossAscends-mods.js';
|
||||||
import { power_user, loadMovingUIState, sortEntitiesList } from './power-user.js';
|
import { power_user, loadMovingUIState, sortEntitiesList } from './power-user.js';
|
||||||
@ -1912,6 +1913,7 @@ export async function getGroupPastChats(groupId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function openGroupChat(groupId, chatId) {
|
export async function openGroupChat(groupId, chatId) {
|
||||||
|
await waitUntilCondition(() => !isChatSaving, debounce_timeout.extended, 10);
|
||||||
const group = groups.find(x => x.id === groupId);
|
const group = groups.find(x => x.id === groupId);
|
||||||
|
|
||||||
if (!group || !group.chats.includes(chatId)) {
|
if (!group || !group.chats.includes(chatId)) {
|
||||||
|
Reference in New Issue
Block a user