mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix async closure call not clearing progress
This commit is contained in:
@ -2241,7 +2241,11 @@ async function echoCallback(args, value) {
|
|||||||
}
|
}
|
||||||
if (args.onClick) {
|
if (args.onClick) {
|
||||||
if (args.onClick instanceof SlashCommandClosure) {
|
if (args.onClick instanceof SlashCommandClosure) {
|
||||||
options.onclick = () => args.onClick.execute();
|
options.onclick = async () => {
|
||||||
|
// Execute the slash command directly, with its internal scope and everything. Clear progress at the end if the main script is already done.
|
||||||
|
await args.onClick.execute();
|
||||||
|
await clearCommandProgress();
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Invalid onClick provided for /echo command. This is not a closure');
|
toastr.warning('Invalid onClick provided for /echo command. This is not a closure');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user