From e5597631639c564305f794fc9d7c23334bb8dd41 Mon Sep 17 00:00:00 2001 From: Danh Date: Thu, 7 Sep 2023 16:05:34 +0700 Subject: [PATCH] support .PNG --- src/hooks/social.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/social.ts b/src/hooks/social.ts index a45d998ca7..1eafb947a1 100644 --- a/src/hooks/social.ts +++ b/src/hooks/social.ts @@ -15,7 +15,7 @@ export const useUploadImageToCloud = () => { try { const file = fileObject as File const ext = file.name?.split('.')?.pop() ?? '' - if (ext && !IMAGE_ALLOW_EXTENSIONS.includes(ext)) throw new Error('File is not support') + if (ext && !IMAGE_ALLOW_EXTENSIONS.includes(ext.toLowerCase())) throw new Error('File is not support') const fileName = `${uuid() + Date.now()}.${ext || 'png'}` const res = await uploadImage({ fileName,