aboutsummaryrefslogtreecommitdiff
path: root/src/components/Settings.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-08-31 22:08:05 +0200
committerVendicated <vendicated@riseup.net>2022-08-31 22:08:05 +0200
commitf60ccb766f30e7518bc348013b72f071f86ecbc6 (patch)
tree5c1cdb5dfc1bbdc620f034308534eb19e0bcb881 /src/components/Settings.tsx
parentbac8a648b6012e221fd2150062d2080b9ed0d702 (diff)
downloadVencord-f60ccb766f30e7518bc348013b72f071f86ecbc6.tar.gz
Vencord-f60ccb766f30e7518bc348013b72f071f86ecbc6.tar.bz2
Vencord-f60ccb766f30e7518bc348013b72f071f86ecbc6.zip
Add Plugin.start, make Settings actually start/stop plugins
Diffstat (limited to 'src/components/Settings.tsx')
-rw-r--r--src/components/Settings.tsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 19f6dd2..ee293bb 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -5,6 +5,8 @@ import IpcEvents from "../utils/IpcEvents";
import { Button, ButtonProps, Flex, Switch, Forms } from "../webpack/common";
import ErrorBoundary from "./ErrorBoundary";
+import { startPlugin } from "../plugins";
+import { stopPlugin } from '../plugins/index';
export default ErrorBoundary.wrap(function Settings(props) {
const [settingsDir, , settingsDirPending] = useAwaiter(() => VencordNative.ipc.invoke<string>(IpcEvents.GET_SETTINGS_DIR), "Loading...");
@@ -52,8 +54,19 @@ export default ErrorBoundary.wrap(function Settings(props) {
settings.plugins[p.name].enabled = v;
if (v) {
p.dependencies?.forEach(d => {
+ // TODO: start every dependency
settings.plugins[d].enabled = true;
});
+ if (!p.started && !startPlugin(p)) {
+ // TODO show notification
+ }
+ } else {
+ if (p.started && !stopPlugin(p)) {
+ // TODO show notification
+ }
+ }
+ if (p.patches) {
+ // TODO show notification
}
}}
note={p.description}