fix: file upload limits in web app

This commit is contained in:
StyleZhang 2024-09-26 16:41:44 +08:00
parent 543503c398
commit b95d0fa9a9
2 changed files with 4 additions and 5 deletions

View File

@ -74,7 +74,7 @@ const Form = () => {
allowed_file_types: appParams?.file_upload?.allowed_file_types, allowed_file_types: appParams?.file_upload?.allowed_file_types,
allowed_file_extensions: appParams?.file_upload?.allowed_file_extensions, allowed_file_extensions: appParams?.file_upload?.allowed_file_extensions,
allowed_file_upload_methods: appParams?.file_upload?.allowed_file_upload_methods, allowed_file_upload_methods: appParams?.file_upload?.allowed_file_upload_methods,
number_limits: appParams?.file_upload?.number_limits, number_limits: appParams?.file_upload?.max_length,
}} }}
/> />
) )

View File

@ -1,4 +1,3 @@
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useEmbeddedChatbotContext } from '../context' import { useEmbeddedChatbotContext } from '../context'
import Input from './form-input' import Input from './form-input'
@ -17,12 +16,12 @@ const Form = () => {
isMobile, isMobile,
} = useEmbeddedChatbotContext() } = useEmbeddedChatbotContext()
const handleFormChange = useCallback((variable: string, value: any) => { const handleFormChange = (variable: string, value: any) => {
handleNewConversationInputsChange({ handleNewConversationInputsChange({
...newConversationInputsRef.current, ...newConversationInputsRef.current,
[variable]: value, [variable]: value,
}) })
}, [newConversationInputs, handleNewConversationInputsChange]) }
const renderField = (form: any) => { const renderField = (form: any) => {
const { const {
@ -87,7 +86,7 @@ const Form = () => {
allowed_file_types: appParams?.file_upload?.allowed_file_types, allowed_file_types: appParams?.file_upload?.allowed_file_types,
allowed_file_extensions: appParams?.file_upload?.allowed_file_extensions, allowed_file_extensions: appParams?.file_upload?.allowed_file_extensions,
allowed_file_upload_methods: appParams?.file_upload?.allowed_file_upload_methods, allowed_file_upload_methods: appParams?.file_upload?.allowed_file_upload_methods,
number_limits: appParams?.file_upload?.number_limits, number_limits: appParams?.file_upload?.max_length,
}} }}
/> />
) )