Disable auto-update setting & settings page has scroll shortcuts (#590)

Fixes https://github.com/dyad-sh/dyad/issues/561
This commit is contained in:
Will Chen
2025-07-07 15:43:06 -07:00
committed by GitHub
parent bc38f9b2d7
commit ab6a9d3b34
28 changed files with 526 additions and 136 deletions

View File

@@ -0,0 +1,36 @@
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 (
<div className="flex items-center space-x-2">
<Switch
id="enable-auto-update"
checked={settings.enableAutoUpdate}
onCheckedChange={(checked) => {
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();
},
},
});
}}
/>
<Label htmlFor="enable-auto-update">Auto-update</Label>
</div>
);
}