fix legacy plugin duplication

This commit is contained in:
AAGaming
2022-07-01 11:50:08 -04:00
parent aa4f1b1e87
commit 934a50f683

View File

@@ -89,7 +89,9 @@ class PluginLoader extends Logger {
this.reloadLock = true;
this.log(`Trying to load ${name}`);
const oldPlugin = this.plugins.find((plugin) => plugin.name === name);
const oldPlugin = this.plugins.find(
(plugin) => plugin.name === name || plugin.name === name.replace('$LEGACY_', ''),
);
if (oldPlugin) {
oldPlugin.onDismount?.();
this.plugins = this.plugins.filter((plugin) => plugin !== oldPlugin);