feat: use new attachment api

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2022-06-01 15:37:05 +05:30
parent 603c5a24de
commit 7a3a939cd8
3 changed files with 65 additions and 50 deletions

View File

@@ -12,8 +12,8 @@ const imageExt = [
export default imageExt
const isImage = (name) => {
return imageExt.some(e => name.toLowerCase().endsWith(`.${e}`))
const isImage = (name, type) => {
return imageExt.some(e => name.toLowerCase().endsWith(`.${e}`)) || (type || '').startsWith('image/')
}
export { isImage }