From 934a50f683f579695292f88437d91d4fce2f4edc Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Fri, 1 Jul 2022 11:50:08 -0400
Subject: fix legacy plugin duplication

---
 frontend/src/plugin-loader.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'frontend/src/plugin-loader.tsx')

diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx
index e0dedb34..b3df0f28 100644
--- a/frontend/src/plugin-loader.tsx
+++ b/frontend/src/plugin-loader.tsx
@@ -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);
-- 
cgit v1.2.3

