File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,8 +151,15 @@ export function SettingsView() {
151151 )
152152
153153 // Resync draft from store if it changes out-of-band (e.g. project switch).
154+ // IMPORTANT: keep the current draft.uiLanguage instead of re-reading
155+ // `i18n.language`. handleSave calls multiple zustand setters before it
156+ // calls `i18n.changeLanguage` at the end, and each setter triggers this
157+ // effect mid-save — which used to clobber the user's pending language
158+ // pick with the still-stale `i18n.language`. The next save would then
159+ // see draft.uiLanguage out of sync with i18n.language and silently
160+ // revert the UI to the previous language.
154161 useEffect ( ( ) => {
155- setDraftState (
162+ setDraftState ( ( prev ) =>
156163 initialDraft (
157164 llmConfig ,
158165 searchApiConfig ,
@@ -161,7 +168,7 @@ export function SettingsView() {
161168 outputLanguage ,
162169 proxyConfig ,
163170 maxHistoryMessages ,
164- i18n . language ,
171+ prev . uiLanguage ,
165172 ) ,
166173 )
167174 } , [
You can’t perform that action at this time.
0 commit comments