mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 06:33:03 -04:00
Add Plugin.start, make Settings actually start/stop plugins
This commit is contained in:
parent
bac8a648b6
commit
f60ccb766f
10 changed files with 146 additions and 58 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue