From a85ec594a77557e5f48c4cf1aa33680e0da94654 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 25 Nov 2022 19:25:35 +0100 Subject: [skip ci] docs docs docs --- src/components/PluginSettings/index.tsx | 2 +- src/components/Settings.tsx | 24 +----------------------- 2 files changed, 2 insertions(+), 24 deletions(-) (limited to 'src/components') diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 2de9362..39fb911 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -302,7 +302,7 @@ export default ErrorBoundary.wrap(function Settings() { changes.add(name)} + onRestartNeeded={name => changes.handleChange(name)} disabled={plugin.required || !!dependency} plugin={plugin} /> diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index e2abff2..f8e7495 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -17,11 +17,10 @@ */ import { useSettings } from "../api/settings"; -import { ChangeList } from "../utils/ChangeList"; import IpcEvents from "../utils/IpcEvents"; import { useAwaiter } from "../utils/misc"; import { downloadSettingsBackup, uploadSettingsBackup } from "../utils/settingsSync"; -import { Alerts, Button, Card, Forms, Margins, Parser, React, Switch } from "../webpack/common"; +import { Button, Card, Forms, Margins, React, Switch } from "../webpack/common"; import DonateButton from "./DonateButton"; import ErrorBoundary from "./ErrorBoundary"; import { Flex } from "./Flex"; @@ -30,27 +29,6 @@ import { handleComponentFailed } from "./handleComponentFailed"; export default ErrorBoundary.wrap(function Settings() { const [settingsDir, , settingsDirPending] = useAwaiter(() => VencordNative.ipc.invoke(IpcEvents.GET_SETTINGS_DIR), "Loading..."); const settings = useSettings(); - const changes = React.useMemo(() => new ChangeList(), []); - - React.useEffect(() => { - return () => void (changes.hasChanges && Alerts.show({ - title: "Restart required", - body: ( - <> -

The following plugins require a restart:

-
{changes.map((s, i) => ( - <> - {i > 0 && ", "} - {Parser.parse("`" + s + "`")} - - ))}
- - ), - confirmText: "Restart now", - cancelText: "Later!", - onConfirm: () => location.reload() - })); - }, []); return ( -- cgit