This is an automated email from the ASF dual-hosted git repository. shuai pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/answer.git
commit c239d8739020d45bc3257952c5f80bcfbcd91a4d Author: gaoxiao6331 <[email protected]> AuthorDate: Sun Feb 23 22:21:17 2025 +0800 fix: fail to switch language --- ui/src/pages/Install/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/src/pages/Install/index.tsx b/ui/src/pages/Install/index.tsx index caf40c05..d607a4a3 100644 --- a/ui/src/pages/Install/index.tsx +++ b/ui/src/pages/Install/index.tsx @@ -22,6 +22,8 @@ import { Container, Row, Col, Card, Alert } from 'react-bootstrap'; import { useTranslation, Trans } from 'react-i18next'; import { Helmet, HelmetProvider } from 'react-helmet-async'; +import { useStore } from 'zustand'; + import type { FormDataType } from '@/common/interface'; import { dbCheck, @@ -38,6 +40,7 @@ import { import { CURRENT_LANG_STORAGE_KEY } from '@/common/constants'; import { BASE_ORIGIN } from '@/router/alias'; import { setupInstallLanguage } from '@/utils/localize'; +import { loggedUserInfoStore } from '@/stores'; import { FirstStep, @@ -137,6 +140,8 @@ const Index: FC = () => { }, }); + const { update, user } = useStore(loggedUserInfoStore); + const updateFormData = (params: FormDataType) => { if (Object.keys(params)?.[0] === 'db_type') { let updatedFormData = formData; @@ -248,6 +253,10 @@ const Index: FC = () => { const handleStep = () => { if (step === 1) { Storage.set(CURRENT_LANG_STORAGE_KEY, formData.lang.value); + update({ + ...user, + language: formData.lang.value, + }); handleNext(); } if (step === 2) {
