mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 01:53:05 -04:00
[skip ci] docs docs docs
This commit is contained in:
parent
c2c6c9fccb
commit
a85ec594a7
7 changed files with 63 additions and 33 deletions
|
@ -302,7 +302,7 @@ export default ErrorBoundary.wrap(function Settings() {
|
|||
<PluginCard
|
||||
onMouseLeave={onMouseLeave}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onRestartNeeded={name => changes.add(name)}
|
||||
onRestartNeeded={name => changes.handleChange(name)}
|
||||
disabled={plugin.required || !!dependency}
|
||||
plugin={plugin}
|
||||
/>
|
||||
|
|
|
@ -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<string>(IpcEvents.GET_SETTINGS_DIR), "Loading...");
|
||||
const settings = useSettings();
|
||||
const changes = React.useMemo(() => new ChangeList<string>(), []);
|
||||
|
||||
React.useEffect(() => {
|
||||
return () => void (changes.hasChanges && Alerts.show({
|
||||
title: "Restart required",
|
||||
body: (
|
||||
<>
|
||||
<p>The following plugins require a restart:</p>
|
||||
<div>{changes.map((s, i) => (
|
||||
<>
|
||||
{i > 0 && ", "}
|
||||
{Parser.parse("`" + s + "`")}
|
||||
</>
|
||||
))}</div>
|
||||
</>
|
||||
),
|
||||
confirmText: "Restart now",
|
||||
cancelText: "Later!",
|
||||
onConfirm: () => location.reload()
|
||||
}));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Forms.FormSection tag="h1" title="Vencord">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue