diff --git a/web/src/components/Chat/ChatToolbar.tsx b/web/src/components/Chat/ChatToolbar.tsx index 6a316bd5..883ac98a 100644 --- a/web/src/components/Chat/ChatToolbar.tsx +++ b/web/src/components/Chat/ChatToolbar.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-17 14:22:25 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-17 18:39:49 + * @Last Modified time: 2026-03-18 15:55:13 */ // Toolbar component for chat input area, supporting file upload, audio recording, and variable configuration import { useRef, forwardRef, useImperativeHandle, type ReactNode, useEffect } from 'react' @@ -120,7 +120,10 @@ const ChatToolbar = forwardRef(({ // Build dropdown menu items based on allowed transfer methods const fileMenus: MenuProps['items'] = [] - if (file_upload?.allowed_transfer_methods?.includes('remote_url')) { + const enabledTypes = ['image', 'document', 'video', 'audio'].filter( + type => file_upload?.[`${type}_enabled` as keyof FeaturesConfigForm['file_upload']] + ) + if (file_upload?.allowed_transfer_methods?.includes('remote_url') && enabledTypes.length > 0) { fileMenus.push({ key: 'url', label: t('memoryConversation.addRemoteFile'), @@ -133,9 +136,6 @@ const ChatToolbar = forwardRef(({ } }) } - const enabledTypes = ['image', 'document', 'video', 'audio'].filter( - type => file_upload?.[`${type}_enabled` as keyof FeaturesConfigForm['file_upload']] - ) if (file_upload?.allowed_transfer_methods?.includes('local_file') && enabledTypes.length > 0) { fileMenus.push({ key: 'upload', @@ -155,7 +155,7 @@ const ChatToolbar = forwardRef(({
-