1 parent ec4a95c commit 1bb46dcCopy full SHA for 1bb46dc
1 file changed
packages/designer/src/plugin/plugin-manager.ts
@@ -143,11 +143,10 @@ export class LowCodePluginManager implements ILowCodePluginManager {
143
}
144
145
async delete(pluginName: string): Promise<boolean> {
146
- const idx = this.plugins.findIndex((plugin) => plugin.name === pluginName);
147
- if (idx === -1) return false;
148
- const plugin = this.plugins[idx];
+ const plugin = this.plugins.find(({ name }) => name === pluginName);
+ if (!plugin) return false;
149
await plugin.destroy();
150
-
+ const idx = this.plugins.indexOf(plugin);
151
this.plugins.splice(idx, 1);
152
return this.pluginsMap.delete(pluginName);
153
0 commit comments