This repository has been archived on 2025-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
aerocord/src/renderer/components/settings/AutoStartToggle.tsx
2024-12-20 18:20:32 -08:00

29 lines
938 B
TypeScript

/*
* SPDX-License-Identifier: GPL-3.0
* Modified for Aerocord, originally part of Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2024-2024 Aiek
* Copyright (c) 2024 RandomServer Community
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { Switch, useState } from "@vencord/types/webpack/common";
import { SettingsComponent } from "./Settings";
export const AutoStartToggle: SettingsComponent = () => {
const [autoStartEnabled, setAutoStartEnabled] = useState(VesktopNative.autostart.isEnabled());
return (
<Switch
value={autoStartEnabled}
onChange={async v => {
await VesktopNative.autostart[v ? "enable" : "disable"]();
setAutoStartEnabled(v);
}}
note="Automatically start Vesktop on computer start-up"
>
Start With System
</Switch>
);
};