mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
Disable imports and char.creation while generating
This could cause data corruption due to active char Id being shifted.
This commit is contained in:
parent
8bbab12848
commit
66a926c8c7
@ -7144,6 +7144,11 @@ async function createOrEditCharacter(e) {
|
||||
formData.set('fav', fav_ch_checked);
|
||||
if ($('#form_create').attr('actiontype') == 'createcharacter') {
|
||||
if ($('#character_name_pole').val().length > 0) {
|
||||
if (is_group_generating || is_send_press) {
|
||||
toastr.error('Cannot create characters while generating. Stop the request and try again.', 'Creation aborted');
|
||||
throw new Error('Cannot import character while generating');
|
||||
}
|
||||
|
||||
//if the character name text area isn't empty (only posible when creating a new character)
|
||||
let url = '/api/characters/create';
|
||||
|
||||
@ -7896,6 +7901,11 @@ export async function processDroppedFiles(files, preserveFileNames = false) {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function importCharacter(file, preserveFileName = false) {
|
||||
if (is_group_generating || is_send_press) {
|
||||
toastr.error('Cannot import characters while generating. Stop the request and try again.', 'Import aborted');
|
||||
throw new Error('Cannot import character while generating');
|
||||
}
|
||||
|
||||
const ext = file.name.match(/\.(\w+)$/);
|
||||
if (!ext || !(['json', 'png', 'yaml', 'yml'].includes(ext[1].toLowerCase()))) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user