From 113f47ca7fb6adf382c89541602b0680dfdc24e2 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 3 Sep 2022 17:49:16 +0200 Subject: Add QuickCss toggle; add settings listener api --- src/components/Settings.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index c7e73be..1e13d7f 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -26,6 +26,8 @@ export default ErrorBoundary.wrap(function Settings(props) { return o; }, []); + const sortedPlugins = React.useMemo(() => Object.values(Plugins).sort((a, b) => a.name.localeCompare(b.name)), []); + return ( SettingsDir: {settingsDir} @@ -50,16 +52,23 @@ export default ErrorBoundary.wrap(function Settings(props) { Settings + settings.useQuickCss = v} + note="Enable QuickCss" + > + Use QuickCss + settings.unsafeRequire = v} note="Enables VencordNative.require. Useful for testing, very bad for security. Leave this off unless you need it." > - Enable Ensafe Require + Enable Unsafe Require Plugins - {Object.values(Plugins).map(p => { + {sortedPlugins.map(p => { const enabledDependants = depMap[p.name]?.filter(d => settings.plugins[d].enabled); const dependency = enabledDependants?.length; -- cgit