mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-16 13:34:04 +08:00
Fixed an issue where clicking the language switcher would cause a brief flash and fail to persist the language change. The root cause was a dependency cycle in useSettingsForm where readPersistedLanguage depended on i18n.language, causing the initialization effect to re-run and reset state whenever the language changed. Changed the dependency from [i18n.language] to [i18n] since the i18n object itself is stable and doesn't change when the language changes, while the function can still access the current language value via closure.