From b78846078c673c40ed885d2359b2f26498209d31 Mon Sep 17 00:00:00 2001 From: KVOJJJin Date: Tue, 6 May 2025 13:15:23 +0800 Subject: [PATCH] Fix: hide view chat setting button when no inputs form (#19263) --- .../base/chat/chat-with-history/header-in-mobile.tsx | 2 ++ .../header/mobile-operation-dropdown.tsx | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/app/components/base/chat/chat-with-history/header-in-mobile.tsx b/web/app/components/base/chat/chat-with-history/header-in-mobile.tsx index 6a8292c54f..ec8da7b102 100644 --- a/web/app/components/base/chat/chat-with-history/header-in-mobile.tsx +++ b/web/app/components/base/chat/chat-with-history/header-in-mobile.tsx @@ -27,6 +27,7 @@ const HeaderInMobile = () => { handleDeleteConversation, handleRenameConversation, conversationRenaming, + inputsForms, } = useChatWithHistoryContext() const { t } = useTranslation() const isPin = pinnedConversationList.some(item => item.id === currentConversationId) @@ -99,6 +100,7 @@ const HeaderInMobile = () => { setShowChatSettings(true)} + hideViewChatSettings={inputsForms.length < 1} /> {showSidebar && ( diff --git a/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx b/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx index f5acf05b6b..4bb694033d 100644 --- a/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx +++ b/web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx @@ -9,11 +9,13 @@ import ActionButton, { ActionButtonState } from '@/app/components/base/action-bu type Props = { handleResetChat: () => void handleViewChatSettings: () => void + hideViewChatSettings?: boolean } const MobileOperationDropdown = ({ handleResetChat, handleViewChatSettings, + hideViewChatSettings = false, }: Props) => { const { t } = useTranslation() const [open, setOpen] = useState(false) @@ -42,9 +44,11 @@ const MobileOperationDropdown = ({
{t('share.chat.resetChat')}
-
- {t('share.chat.viewChatSettings')} -
+ {!hideViewChatSettings && ( +
+ {t('share.chat.viewChatSettings')} +
+ )}