aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-01 22:09:20 +0200
committerVendicated <vendicated@riseup.net>2022-10-01 22:09:20 +0200
commit2410582cf8f607990ce9e9b6b92360bba98f6a57 (patch)
tree672ddb30b1da5ed27c06862017bb4f51fee5d931 /src/plugins
parentcac77dce406be92755519be595cf460e8f758b16 (diff)
downloadVencord-2410582cf8f607990ce9e9b6b92360bba98f6a57.tar.gz
Vencord-2410582cf8f607990ce9e9b6b92360bba98f6a57.tar.bz2
Vencord-2410582cf8f607990ce9e9b6b92360bba98f6a57.zip
Dedicated Updater Page, Settings feedback
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/index.ts57
-rw-r--r--src/plugins/settings.ts3
2 files changed, 31 insertions, 29 deletions
diff --git a/src/plugins/index.ts b/src/plugins/index.ts
index e4d0775..e03c588 100644
--- a/src/plugins/index.ts
+++ b/src/plugins/index.ts
@@ -23,37 +23,38 @@ export function startAllPlugins() {
}
export function startPlugin(p: Plugin) {
- if (p.start) {
- logger.info("Starting plugin", p.name);
- if (p.started) {
- logger.warn(`${p.name} already started`);
- return false;
- }
- try {
- p.start();
- p.started = true;
- return true;
- } catch (err: any) {
- logger.error(`Failed to start ${p.name}\n`, err);
- return false;
- }
+ if (!p.start) return true;
+
+ logger.info("Starting plugin", p.name);
+ if (p.started) {
+ logger.warn(`${p.name} already started`);
+ return false;
+ }
+
+ try {
+ p.start();
+ p.started = true;
+ return true;
+ } catch (err: any) {
+ logger.error(`Failed to start ${p.name}\n`, err);
+ return false;
}
}
export function stopPlugin(p: Plugin) {
- if (p.stop) {
- logger.info("Stopping plugin", p.name);
- if (!p.started) {
- logger.warn(`${p.name} already stopped / never started`);
- return false;
- }
- try {
- p.stop();
- p.started = false;
- return true;
- } catch (err: any) {
- logger.error(`Failed to stop ${p.name}\n`, err);
- return false;
- }
+ if (!p.stop) return true;
+
+ logger.info("Stopping plugin", p.name);
+ if (!p.started) {
+ logger.warn(`${p.name} already stopped / never started`);
+ return false;
+ }
+ try {
+ p.stop();
+ p.started = false;
+ return true;
+ } catch (err: any) {
+ logger.error(`Failed to stop ${p.name}\n`, err);
+ return false;
}
}
diff --git a/src/plugins/settings.ts b/src/plugins/settings.ts
index afefa91..2ed85e6 100644
--- a/src/plugins/settings.ts
+++ b/src/plugins/settings.ts
@@ -27,7 +27,8 @@ export default definePlugin({
match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,
replace: (m, mod) =>
`{section:${mod}.ID.HEADER,label:"Vencord"},` +
- `{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` +
+ `{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},` +
+ `{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater},` +
`{section:${mod}.ID.DIVIDER},${m}`
}