浏览代码

Fix: hide view chat setting button when no inputs form (#19263)

tags/1.4.0
KVOJJJin 6 个月前
父节点
当前提交
b78846078c
没有帐户链接到提交者的电子邮件

+ 2
- 0
web/app/components/base/chat/chat-with-history/header-in-mobile.tsx 查看文件

handleDeleteConversation, handleDeleteConversation,
handleRenameConversation, handleRenameConversation,
conversationRenaming, conversationRenaming,
inputsForms,
} = useChatWithHistoryContext() } = useChatWithHistoryContext()
const { t } = useTranslation() const { t } = useTranslation()
const isPin = pinnedConversationList.some(item => item.id === currentConversationId) const isPin = pinnedConversationList.some(item => item.id === currentConversationId)
<MobileOperationDropdown <MobileOperationDropdown
handleResetChat={handleNewConversation} handleResetChat={handleNewConversation}
handleViewChatSettings={() => setShowChatSettings(true)} handleViewChatSettings={() => setShowChatSettings(true)}
hideViewChatSettings={inputsForms.length < 1}
/> />
</div> </div>
{showSidebar && ( {showSidebar && (

+ 7
- 3
web/app/components/base/chat/chat-with-history/header/mobile-operation-dropdown.tsx 查看文件

type Props = { type Props = {
handleResetChat: () => void handleResetChat: () => void
handleViewChatSettings: () => void handleViewChatSettings: () => void
hideViewChatSettings?: boolean
} }


const MobileOperationDropdown = ({ const MobileOperationDropdown = ({
handleResetChat, handleResetChat,
handleViewChatSettings, handleViewChatSettings,
hideViewChatSettings = false,
}: Props) => { }: Props) => {
const { t } = useTranslation() const { t } = useTranslation()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
<div className='system-md-regular flex cursor-pointer items-center space-x-1 rounded-lg px-3 py-1.5 text-text-secondary hover:bg-state-base-hover' onClick={handleResetChat}> <div className='system-md-regular flex cursor-pointer items-center space-x-1 rounded-lg px-3 py-1.5 text-text-secondary hover:bg-state-base-hover' onClick={handleResetChat}>
<span className='grow'>{t('share.chat.resetChat')}</span> <span className='grow'>{t('share.chat.resetChat')}</span>
</div> </div>
<div className='system-md-regular flex cursor-pointer items-center space-x-1 rounded-lg px-3 py-1.5 text-text-secondary hover:bg-state-base-hover' onClick={handleViewChatSettings}>
<span className='grow'>{t('share.chat.viewChatSettings')}</span>
</div>
{!hideViewChatSettings && (
<div className='system-md-regular flex cursor-pointer items-center space-x-1 rounded-lg px-3 py-1.5 text-text-secondary hover:bg-state-base-hover' onClick={handleViewChatSettings}>
<span className='grow'>{t('share.chat.viewChatSettings')}</span>
</div>
)}
</div> </div>
</PortalToFollowElemContent> </PortalToFollowElemContent>
</PortalToFollowElem> </PortalToFollowElem>

正在加载...
取消
保存