Skip to content

Commit

Permalink
support .PNG
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Sep 7, 2023
1 parent 7ce68cf commit e559763
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e559763

Please sign in to comment.