From ae501c58faea4df6f12a33d79a3339ffa093ee9b Mon Sep 17 00:00:00 2001 From: balibabu Date: Sun, 28 Apr 2024 11:50:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20display=20the=20current=20language=20dir?= =?UTF-8?q?ectly=20at=20the=20top=20and=20do=20not=20disp=E2=80=A6=20(#579?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …lay reference symbols for documents in external chat boxes #566 #577 ### What problem does this PR solve? fix: display the current language directly at the top and do not display reference symbols for documents in external chat boxes #566 #577 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../layouts/components/right-toolbar/index.less | 4 ++++ .../layouts/components/right-toolbar/index.tsx | 16 +++++++++------- web/src/pages/chat/shared-hooks.ts | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/web/src/layouts/components/right-toolbar/index.less b/web/src/layouts/components/right-toolbar/index.less index 9f9b9ebc3..2749f19b4 100644 --- a/web/src/layouts/components/right-toolbar/index.less +++ b/web/src/layouts/components/right-toolbar/index.less @@ -15,3 +15,7 @@ vertical-align: middle; cursor: pointer; } + +.language { + cursor: pointer; +} diff --git a/web/src/layouts/components/right-toolbar/index.tsx b/web/src/layouts/components/right-toolbar/index.tsx index d60ec463f..68e99201f 100644 --- a/web/src/layouts/components/right-toolbar/index.tsx +++ b/web/src/layouts/components/right-toolbar/index.tsx @@ -1,6 +1,5 @@ -import { ReactComponent as TranslationIcon } from '@/assets/svg/translation.svg'; import { useTranslate } from '@/hooks/commonHooks'; -import { GithubOutlined } from '@ant-design/icons'; +import { DownOutlined, GithubOutlined } from '@ant-design/icons'; import { Dropdown, MenuProps, Space } from 'antd'; import camelCase from 'lodash/camelCase'; import React from 'react'; @@ -8,6 +7,7 @@ import User from '../user'; import { LanguageList } from '@/constants/common'; import { useChangeLanguage } from '@/hooks/logicHooks'; +import { useSelector } from 'umi'; import styled from './index.less'; const Circle = ({ children, ...restProps }: React.PropsWithChildren) => { @@ -25,6 +25,7 @@ const handleGithubCLick = () => { const RightToolBar = () => { const { t } = useTranslate('common'); const changeLanguage = useChangeLanguage(); + const { language = '' } = useSelector((state) => state.settingModel.userInfo); const handleItemClick: MenuProps['onClick'] = ({ key }) => { changeLanguage(key); @@ -40,14 +41,15 @@ const RightToolBar = () => { return (
+ + + {t(camelCase(language))} + + + - - - - - {/* */} diff --git a/web/src/pages/chat/shared-hooks.ts b/web/src/pages/chat/shared-hooks.ts index bb511a0ef..4d6877dcf 100644 --- a/web/src/pages/chat/shared-hooks.ts +++ b/web/src/pages/chat/shared-hooks.ts @@ -129,6 +129,7 @@ export const useSendSharedMessage = ( async (message: string, id?: string) => { const retcode = await completeConversation({ conversation_id: id ?? conversationId, + quote: false, messages: [ ...(conversation?.message ?? []).map((x: IMessage) => omit(x, 'id')), {