Chat2API
Chat2API copied to clipboard
fix: add save button to settings page with draft mode
Summary
Fixes #76 — settings page changes were not always persisting correctly with the instant-save approach. This PR converts settings controls to draft mode with an explicit save button.
Changes
- settingsStore: All setters are now synchronous (zustand only), new
saveSettings()batches and persists to backend - AppearanceSettings: theme, language, sidebar → draft + save button
- GeneralSettings: autoStart, autoStartProxy, minimizeToTray, closeBehavior, notifications, oauthProxyMode → draft + save button
- DataManagement: logLevel, logRetentionDays, maxLogs → draft + save button; requestLogConfig stays immediate-save
- i18n: Added
save,saving,saveSuccess,saveFailedkeys (zh-CN + en-US)
How it works
- User changes any setting → updates local
useStatedraft only - User clicks "Save Settings" button → writes drafts to store → calls
saveSettings()to persist viawindow.electronAPI.config.update() - Toast feedback on success / failure
Closes #76
@codex review