diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx index 2d1f868a26..34175bac01 100644 --- a/web/app/components/base/chat/chat/chat-input-area/index.tsx +++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx @@ -63,7 +63,7 @@ const ChatInputArea = ({ const handleSend = () => { if (onSend) { - if (files.find(item => item.type === TransferMethod.local_file && !item.fileStorageId)) { + if (files.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId)) { notify({ type: 'info', message: t('appDebug.errorMessage.waitForImgUpload') }) return } diff --git a/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx b/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx index 940cff2f08..d876c7a5c4 100644 --- a/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx +++ b/web/app/components/base/file-uploader/file-from-link-or-local/index.tsx @@ -61,7 +61,7 @@ const FileFromLinkOrLocal = ({ size='small' variant='primary' disabled={!url || disabled} - onClick={() => handleLoadFileFromLink()} + onClick={() => handleLoadFileFromLink(url)} > {t('common.operation.ok')} diff --git a/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx b/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx index 00fbf402dc..7facb39871 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-attachment/file-item.tsx @@ -7,37 +7,33 @@ import FileTypeIcon from '../file-type-icon' import { getFileAppearanceType, getFileExtension, - isImage, } from '../utils' import FileImageRender from '../file-image-render' +import type { FileEntity } from '../types' import ActionButton from '@/app/components/base/action-button' import ProgressCircle from '@/app/components/base/progress-bar/progress-circle' import { formatFileSize } from '@/utils/format' import cn from '@/utils/classnames' import { ReplayLine } from '@/app/components/base/icons/src/vender/other' +import { SupportUploadFileTypes } from '@/app/components/workflow/types' type FileInAttachmentItemProps = { - fileId: string - file: File - imageUrl?: string - progress?: number + file: FileEntity showDeleteAction?: boolean showDownloadAction?: boolean onRemove?: (fileId: string) => void onReUpload?: (fileId: string) => void } const FileInAttachmentItem = ({ - fileId, file, - imageUrl, - progress = 0, showDeleteAction, showDownloadAction = true, onRemove, onReUpload, }: FileInAttachmentItemProps) => { - const isImageFile = isImage(file) - const ext = getFileExtension(file) + const { id, name, progress, supportFileType, base64Url, url } = file + const ext = getFileExtension(name) + const isImageFile = supportFileType === SupportUploadFileTypes.image return (
) } { !isImageFile && (