From c29a60d623fdfb7586ea2df045d0c67ba60a3b17 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 12 Oct 2024 23:26:46 +0800 Subject: [PATCH] fix(client): fix wrongly thumbnail previewing when file type is not supported by default (#5401) --- .../core/client/src/schema-component/antd/upload/shared.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/upload/shared.ts b/packages/core/client/src/schema-component/antd/upload/shared.ts index aae2086a74..f334502859 100644 --- a/packages/core/client/src/schema-component/antd/upload/shared.ts +++ b/packages/core/client/src/schema-component/antd/upload/shared.ts @@ -93,11 +93,7 @@ const testOpts = (ext: RegExp, options: { exclude?: string[]; include?: string[] }; export function getThumbnailPlaceholderURL(file, options: any = {}) { - if (file.url) { - return file.url; - } for (let i = 0; i < UPLOAD_PLACEHOLDER.length; i++) { - // console.log(UPLOAD_PLACEHOLDER[i].ext, testOpts(UPLOAD_PLACEHOLDER[i].ext, options)); if (UPLOAD_PLACEHOLDER[i].ext.test(file.extname || file.filename || file.url || file.name)) { if (testOpts(UPLOAD_PLACEHOLDER[i].ext, options)) { return UPLOAD_PLACEHOLDER[i].icon || UNKNOWN_FILE_ICON;