Add check for duplicate action registration
- Added a check in the registerAction method to prevent duplicate actions from being registered. - Removed the line that clears the actions array in the loadCustomActions method.
This commit is contained in:
parent
e0c638e3c0
commit
4c34d06b33
@ -72,6 +72,10 @@ export default class ActionManager {
|
||||
}
|
||||
|
||||
public registerAction(action: Action): void {
|
||||
const existAction = this.actions.find(a => a.name === action.name);
|
||||
if (existAction) {
|
||||
return ;
|
||||
}
|
||||
this.actions.push(action);
|
||||
}
|
||||
|
||||
@ -169,7 +173,6 @@ export default class ActionManager {
|
||||
}
|
||||
|
||||
public loadCustomActions(workflowsDir: string): void {
|
||||
this.actions = [];
|
||||
const customActionsInstance = CustomActions.getInstance();
|
||||
customActionsInstance.parseActions(workflowsDir);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user