diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/VencordSettings/Updater.tsx | 22 | ||||
-rw-r--r-- | src/components/VencordSettings/VencordTab.tsx | 21 |
2 files changed, 34 insertions, 9 deletions
diff --git a/src/components/VencordSettings/Updater.tsx b/src/components/VencordSettings/Updater.tsx index dea8766..8a126a8 100644 --- a/src/components/VencordSettings/Updater.tsx +++ b/src/components/VencordSettings/Updater.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { useSettings } from "@api/settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; @@ -23,7 +24,7 @@ import { handleComponentFailed } from "@components/handleComponentFailed"; import { Link } from "@components/Link"; import { classes, useAwaiter } from "@utils/misc"; import { changes, checkForUpdates, getRepo, isNewer, rebuild, update, updateError, UpdateLogger } from "@utils/updater"; -import { Alerts, Button, Card, Forms, Margins, Parser, React, Toasts } from "@webpack/common"; +import { Alerts, Button, Card, Forms, Margins, Parser, React, Switch, Toasts } from "@webpack/common"; import gitHash from "~git-hash"; @@ -183,6 +184,8 @@ function Newer(props: CommonProps) { } function Updater() { + const settings = useSettings(["notifyAboutUpdates", "autoUpdate"]); + const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: "Loading..." }); React.useEffect(() => { @@ -197,6 +200,23 @@ function Updater() { return ( <Forms.FormSection> + <Forms.FormTitle tag="h5">Updater Settings</Forms.FormTitle> + <Switch + value={settings.notifyAboutUpdates} + onChange={(v: boolean) => settings.notifyAboutUpdates = v} + note="Shows a toast on startup" + disabled={settings.autoUpdate} + > + Get notified about new updates + </Switch> + <Switch + value={settings.autoUpdate} + onChange={(v: boolean) => settings.autoUpdate = v} + note="Automatically update Vencord without confirmation prompt" + > + Automatically update + </Switch> + <Forms.FormTitle tag="h5">Repo</Forms.FormTitle> <Forms.FormText>{repoPending ? repo : err ? "Failed to retrieve - check console" : ( diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index 9429cdd..5da4442 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -97,21 +97,26 @@ function VencordSettings() { <Switch value={settings.enableReactDevtools} onChange={(v: boolean) => settings.enableReactDevtools = v} - note="Requires a full restart"> + note="Requires a full restart" + > Enable React Developer Tools </Switch> <Switch - value={settings.notifyAboutUpdates} - onChange={(v: boolean) => settings.notifyAboutUpdates = v} - note="Shows a toast on startup"> - Get notified about new updates - </Switch> - <Switch value={settings.frameless} onChange={(v: boolean) => settings.frameless = v} - note="Requires a full restart"> + note="Requires a full restart" + > Disable the window frame </Switch> + {navigator.platform.toLowerCase().startsWith("win") && ( + <Switch + value={settings.winCtrlQ} + onChange={(v: boolean) => settings.winCtrlQ = v} + note="Requires a full restart" + > + Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4) + </Switch> + )} </React.Fragment> )} |