Pārlūkot izejas kodu

fix: file download in chat (#11322)

zxhlyh 4 mēneši atpakaļ
vecāks
revīzija
98a1b01b0c

+ 1 - 1
web/app/components/base/file-uploader/file-uploader-in-chat-input/file-image-item.tsx

@@ -84,7 +84,7 @@ const FileImageItem = ({
                 className='absolute bottom-0.5 right-0.5  flex items-center justify-center w-6 h-6 rounded-lg bg-components-actionbar-bg shadow-md'
                 onClick={(e) => {
                   e.stopPropagation()
-                  downloadFile(url || '', name)
+                  downloadFile(url || base64Url || '', name)
                 }}
               >
                 <RiDownloadLine className='w-4 h-4 text-text-tertiary' />

+ 1 - 1
web/app/components/base/file-uploader/file-uploader-in-chat-input/file-item.tsx

@@ -80,7 +80,7 @@ const FileItem = ({
           }
         </div>
         {
-          showDownloadAction && (
+          showDownloadAction && url && (
             <ActionButton
               size='m'
               className='hidden group-hover/file-item:flex absolute -right-1 -top-1'