fix(toolbox): Preserve user-specified tool state and streamline command execution (#4063)

This commit is contained in:
Alireza authored and GitHub committed 2024-04-29 11:58:03 -04:00
1 parent 4784638717
commit f1a736d193
34 files changed
+332 -181

No files matched your search

+7 -2
View File
@@ -204,7 +204,8 @@ export class CommandsManager {
// Execute each command in the array
let result: unknown;
commands.forEach(({ commandName, commandOptions, context }) => {
commands.forEach(command => {
const { commandName, commandOptions, context } = command;
if (commandName) {
result = this.runCommand(
commandName,
@@ -215,7 +216,11 @@ export class CommandsManager {
context
);
} else {
console.warn('No command name supplied in', toRun);
if (typeof command === 'function') {
result = command();
} else {
console.warn('No command name supplied in', toRun);
}
}
});