fix: upload custom file extension (#10801)
This commit is contained in:
@@ -82,8 +82,6 @@ const FileUploadSetting: FC<Props> = ({
|
||||
const handleCustomFileTypesChange = useCallback((customFileTypes: string[]) => {
|
||||
const newPayload = produce(payload, (draft) => {
|
||||
draft.allowed_file_extensions = customFileTypes.map((v) => {
|
||||
if (v.startsWith('.')) // Not start with dot
|
||||
return v.slice(1)
|
||||
return v
|
||||
})
|
||||
})
|
||||
@@ -118,7 +116,7 @@ const FileUploadSetting: FC<Props> = ({
|
||||
type={SupportUploadFileTypes.custom}
|
||||
selected={allowed_file_types.includes(SupportUploadFileTypes.custom)}
|
||||
onToggle={handleSupportFileTypeChange}
|
||||
customFileTypes={allowed_file_extensions?.map(item => `.${item}`)}
|
||||
customFileTypes={allowed_file_extensions}
|
||||
onCustomFileTypesChange={handleCustomFileTypesChange}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user