fix(toolbox): Preserve user-specified tool state and streamline command execution (#4063)
This commit is contained in:
1 parent
4784638717
commit
f1a736d193
34 files changed
+332
-181
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user