fix /abort toasts in /while

This commit is contained in:
LenAnderson 2024-05-19 06:25:00 -04:00
parent 89de668241
commit 1f18694aa6
1 changed files with 8 additions and 5 deletions

View File

@ -342,14 +342,17 @@ async function whileCallback(args, value) {
if (result && command) {
if (command instanceof SlashCommandClosure) {
commandResult = await command.execute();
// don't suppress potentially loud /abort (need to bubble up to executeSlashCommandsWithOptions for toast)
if (commandResult.isAborted) break;
} else {
commandResult = await executeSubCommands(command, args._scope, args._parserFlags, args._abortController);
}
if (commandResult.isAborted) {
args._abortController.abort(commandResult.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;
}
}
} else {
break;
}