aboutsummaryrefslogtreecommitdiff
path: root/src/components/PluginSettings
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-06-13 02:29:15 +0200
committerV <vendicated@riseup.net>2023-06-13 02:29:29 +0200
commit42d8211871d84e2650f7c762c66e2ee2e6c58968 (patch)
treec07b39db5a7a86fb2a9e6c02a7d8e03b85e763c6 /src/components/PluginSettings
parentab3e9932749d3d5a226cb08906f5c8335d9581c5 (diff)
downloadVencord-42d8211871d84e2650f7c762c66e2ee2e6c58968.tar.gz
Vencord-42d8211871d84e2650f7c762c66e2ee2e6c58968.tar.bz2
Vencord-42d8211871d84e2650f7c762c66e2ee2e6c58968.zip
Fix disabling plugins whose stop() errors
Diffstat (limited to 'src/components/PluginSettings')
-rw-r--r--src/components/PluginSettings/index.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx
index e1b36ef..655eeef 100644
--- a/src/components/PluginSettings/index.tsx
+++ b/src/components/PluginSettings/index.tsx
@@ -138,11 +138,13 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
}
const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin);
- const action = wasEnabled ? "stop" : "start";
if (!result) {
- logger.error(`Failed to ${action} plugin ${plugin.name}`);
- showErrorToast(`Failed to ${action} plugin: ${plugin.name}`);
+ settings.enabled = false;
+
+ const msg = `Error while ${wasEnabled ? "stopping" : "starting"} plugin ${plugin.name}`;
+ logger.error(msg);
+ showErrorToast(msg);
return;
}