mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-05-25 15:54:18 +02:00
Silent /abort
This commit is contained in:
parent
64b0123acf
commit
d9f9da99e6
@ -1423,7 +1423,7 @@ async function runCallback(args, name) {
|
|||||||
|
|
||||||
function abortCallback() {
|
function abortCallback() {
|
||||||
$('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles:true }));
|
$('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles:true }));
|
||||||
throw new Error('/abort command executed');
|
throw new Error('/abort command executed', { cause: 'abort' });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function delayCallback(_, amount) {
|
async function delayCallback(_, amount) {
|
||||||
@ -2749,10 +2749,12 @@ export async function executeSlashCommandsOnChatInput(text, options = {}) {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
document.querySelector('#form_sheld').classList.add('script_error');
|
document.querySelector('#form_sheld').classList.add('script_error');
|
||||||
toastr.error(e.message);
|
|
||||||
result = new SlashCommandClosureResult();
|
result = new SlashCommandClosureResult();
|
||||||
result.isError = true;
|
result.isError = true;
|
||||||
result.errorMessage = e.message;
|
result.errorMessage = e.message;
|
||||||
|
if (e.cause !== 'abort') {
|
||||||
|
toastr.error(e.message);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
delay(1000).then(()=>clearCommandProgressDebounced());
|
delay(1000).then(()=>clearCommandProgressDebounced());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user