Skip to content

Commit 8da2b75

Browse files
author
JemyCheung
committed
find to foreach
1 parent 50941e1 commit 8da2b75

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,13 @@ function getUpHosts(token) {
265265
}
266266

267267
export function findMimeType(fileType, mimeType) {
268-
return mimeType.find((elem) => {
269-
return fileType == elem;
270-
});
268+
var rtType = null;
269+
mimeType.forEach(elem => {
270+
if(fileType == elem){
271+
rtType = fileType;
272+
}
273+
});
274+
return rtType;
271275
}
272276

273277
export function createObjectURL(file) {

0 commit comments

Comments
 (0)