fix: file size calculation error

MDN: The Blob interface's size property returns the size of the Blob or File in bytes
This commit is contained in:
HD
2022-06-28 10:35:11 +08:00
parent 6bf64e38fc
commit ccfee28e13
+1 -2
View File
@@ -14,8 +14,7 @@ export const isImage = (file_type = "", size = 0) => {
export const isTreatAsImage = (file: File) => {
const { type, size } = file;
if (type.startsWith("image")) {
// 10MB
return size < 1000 * 1000;
return size < 1024 * 1024; // 10MB
}
return false;
};