import { useSettings } from "@/hooks/useSettings"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { toast } from "sonner"; import { IpcClient } from "@/ipc/ipc_client"; export function AutoUpdateSwitch() { const { settings, updateSettings } = useSettings(); if (!settings) { return null; } return (
{ updateSettings({ enableAutoUpdate: checked }); toast("Auto-update settings changed", { description: "You will need to restart Dyad for your settings to take effect.", action: { label: "Restart Dyad", onClick: () => { IpcClient.getInstance().restartDyad(); }, }, }); }} />
); }