Unindent, plugins is now an object instead of []

This commit is contained in:
Vendicated 2022-08-31 23:04:18 +02:00
parent b2f762fda8
commit 7ce37f858c
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
8 changed files with 65 additions and 14 deletions

View file

@ -45,7 +45,7 @@ export default ErrorBoundary.wrap(function Settings(props) {
</Switch>
<Forms.FormDivider />
<Forms.FormTitle tag="h5">Plugins</Forms.FormTitle>
{Plugins.map(p => (
{Object.values(Plugins).map(p => (
<Switch
disabled={p.required === true}
key={p.name}
@ -54,8 +54,11 @@ 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 (!Plugins[d].started && !stopPlugin) {
// TODO show notification
settings.plugins[p.name].enabled = false;
}
});
if (!p.started && !startPlugin(p)) {
// TODO show notification