Fixed an issue where refreshing the login page caused the language settings to become invalid. #249 (#250)

### What problem does this PR solve?

Fixed an issue where refreshing the login page caused the language
settings to become invalid.

Issue link: #249

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-04-08 10:41:03 +08:00
committed by GitHub
parent c829799474
commit d0a1ffe6e2
8 changed files with 26 additions and 22 deletions

View File

@ -1,16 +1,15 @@
import { ReactComponent as StarIon } from '@/assets/svg/chat-star.svg';
import { ReactComponent as KnowledgeBaseIcon } from '@/assets/svg/knowledge-base.svg';
import { ReactComponent as Logo } from '@/assets/svg/logo.svg';
import { useTranslate } from '@/hooks/commonHooks';
import { useNavigateWithFromState } from '@/hooks/routeHook';
import { Layout, Radio, Space, theme } from 'antd';
import { useCallback, useMemo } from 'react';
import { useLocation } from 'umi';
import Toolbar from '../right-toolbar';
import styles from './index.less';
import { useNavigateWithFromState } from '@/hooks/routeHook';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'umi';
const { Header } = Layout;
const RagHeader = () => {
@ -19,7 +18,7 @@ const RagHeader = () => {
} = theme.useToken();
const navigate = useNavigateWithFromState();
const { pathname } = useLocation();
const { t } = useTranslation('translation', { keyPrefix: 'header' });
const { t } = useTranslate('header');
const tagsData = useMemo(
() => [