Преглед на файлове

Fix: type missing of remote file in chat (#9652)

KVOJJJin преди 6 месеца
родител
ревизия
d700abff0a
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      web/app/components/base/file-uploader/utils.ts

+ 3 - 3
web/app/components/base/file-uploader/utils.ts

@@ -44,6 +44,9 @@ export const fileUpload: FileUpload = ({
 }
 
 export const getFileExtension = (fileName: string, fileMimetype: string) => {
+  if (fileMimetype)
+    return mime.getExtension(fileMimetype) || ''
+
   if (fileName) {
     const fileNamePair = fileName.split('.')
     const fileNamePairLength = fileNamePair.length
@@ -52,9 +55,6 @@ export const getFileExtension = (fileName: string, fileMimetype: string) => {
       return fileNamePair[fileNamePairLength - 1]
   }
 
-  if (fileMimetype)
-    return mime.getExtension(fileMimetype) || ''
-
   return ''
 }