setShowFixModal(true)}
diff --git a/src/components/ui/SettingsToggle.tsx b/src/components/ui/SettingsToggle.tsx
index 4bb35fc5..6063bcd4 100644
--- a/src/components/ui/SettingsToggle.tsx
+++ b/src/components/ui/SettingsToggle.tsx
@@ -1,7 +1,14 @@
import SettingsButton from './SettingsButton'
+type SettingsToggleOption = {
+ value: string
+ label: string
+ disabled?: boolean
+ disabledTooltip?: string
+}
+
type SettingsToggleProps = {
- options: { value: string; label: string }[]
+ options: SettingsToggleOption[]
value: string
onChange: (value: string) => void
}
@@ -9,14 +16,21 @@ type SettingsToggleProps = {
const SettingsToggle = ({ options, value, onChange }: SettingsToggleProps) => (
{options.map((option) => (
- onChange(option.value)}
- >
- {option.label}
-
+
+ onChange(option.value)}
+ disabled={option.disabled}
+ aria-disabled={option.disabled ? 'true' : undefined}
+ >
+ {option.label}
+
+
))}
)
diff --git a/src/hooks/useSettings.tsx b/src/hooks/useSettings.tsx
index 2db28d05..058365bd 100644
--- a/src/hooks/useSettings.tsx
+++ b/src/hooks/useSettings.tsx
@@ -65,7 +65,8 @@ export const SettingsProvider = ({ children }: { children: ReactNode }) => {
const saveSettings = useCallback(async (newSettings: Settings) => {
try {
await invoke('write-settings', newSettings)
- setSettings(newSettings)
+ const persisted = await invoke('read-settings')
+ setSettings(persisted)
setError(null)
return true
} catch (err) {