mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
chore: safer plugins.delete
This commit is contained in:
parent
ec4a95c9ba
commit
1bb46dcf3b
@ -143,11 +143,10 @@ export class LowCodePluginManager implements ILowCodePluginManager {
|
||||
}
|
||||
|
||||
async delete(pluginName: string): Promise<boolean> {
|
||||
const idx = this.plugins.findIndex((plugin) => plugin.name === pluginName);
|
||||
if (idx === -1) return false;
|
||||
const plugin = this.plugins[idx];
|
||||
const plugin = this.plugins.find(({ name }) => name === pluginName);
|
||||
if (!plugin) return false;
|
||||
await plugin.destroy();
|
||||
|
||||
const idx = this.plugins.indexOf(plugin);
|
||||
this.plugins.splice(idx, 1);
|
||||
return this.pluginsMap.delete(pluginName);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user