mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-13 10:42:55 +01:00
Fix async closure call not clearing progress
This commit is contained in:
parent
e48ff8daae
commit
ad04d0c9a2
@ -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');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user