truly disable check problems (#566)

This commit is contained in:
Will Chen
2025-07-03 17:51:37 -07:00
committed by GitHub
parent d0f6e40378
commit 77e39874ad
4 changed files with 38 additions and 13 deletions

View File

@@ -2,7 +2,13 @@ import { useSettings } from "@/hooks/useSettings";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
export function AutoFixProblemsSwitch() {
import { showInfo } from "@/lib/toast";
export function AutoFixProblemsSwitch({
showToast = false,
}: {
showToast?: boolean;
}) {
const { settings, updateSettings } = useSettings();
return (
<div className="flex items-center space-x-2">
@@ -13,6 +19,9 @@ export function AutoFixProblemsSwitch() {
updateSettings({
enableAutoFixProblems: !settings?.enableAutoFixProblems,
});
if (!settings?.enableAutoFixProblems && showToast) {
showInfo("You can disable Auto-fix problems in the Settings page.");
}
}}
/>
<Label htmlFor="auto-fix-problems">Auto-fix problems</Label>