mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
fix /abort toast and loop break in /times
This commit is contained in:
@ -393,11 +393,15 @@ async function timesCallback(args, value) {
|
|||||||
if (command instanceof SlashCommandClosure) {
|
if (command instanceof SlashCommandClosure) {
|
||||||
command.scope.setMacro('timesIndex', i);
|
command.scope.setMacro('timesIndex', i);
|
||||||
result = await command.execute();
|
result = await command.execute();
|
||||||
|
// don't suppress potentially loud /abort (need to bubble up to executeSlashCommandsWithOptions for toast)
|
||||||
|
if (result.isAborted) break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = await executeSubCommands(command.replace(/\{\{timesIndex\}\}/g, i.toString()), args._scope, args._parserFlags);
|
result = await executeSubCommands(command.replace(/\{\{timesIndex\}\}/g, i.toString()), args._scope, args._parserFlags, args._abortController);
|
||||||
if (result.isAborted) {
|
if (result.isAborted) {
|
||||||
args._abortController.abort(result.abortReason, true);
|
// abort toast (if loud) is already shown in subcommand execution,
|
||||||
|
// overwrite signal to quiet to prevent second toast from ancestor executions
|
||||||
|
args._abortController.signal.isQuiet = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user